目录

(Optional) Optimizing the App Package Size

If you integrate the Location SDK 6.0.0 or later, you can configure the app-level build.gradle file to specify a list of platforms that are not required for your app, reducing your app package size.

  1. Open the app-level build.gradle file of your project.

  2. Add packagingOptions to the android block to specify platforms that need to be excluded. The sample code is as follows:
    android {    
        packagingOptions {
            // Exclude the SO file on which the x86 platform depends. 
            exclude "lib/x86/libucs-credential.so"
            // Exclude the SO file on which the x86_64 platform depends. 
            exclude "lib/x86_64/libucs-credential.so"
        } 
    }

    The sample code deletes the SO files on which the x86 and x86_64 platforms depend from the Location SDK. After the deletion, it is expected that the package size can be reduced by 360 KB.