.aar
file we publish to Maven Central.
Below are various options to reduce the size of your application package. These change aspects of the Ditto SDK as it is included inside your app’s final .apk
file.
.aab
files) and automatic package optimization.
However, if your MDM system does not support this, there are several options for manually optimizing the size of your app package.
useLegacyPackaging
value to true
in your app’s Gradle configuration will change this to store the binaries in compressed form. Compressed binaries will take up less space and help to reduce the app’s final .apk
file size.
In your app’s build.gradle(.kts)
file, add the following jniLibs
block inside the packaging
block.
useLegacyPackaging
build option can also be controlled using the (deprecated)android:extractNativeLibs
attribute on the <application>
element in the Android manifest. This option used to be available using the android.bundle.enableUncompressedNativeLibs
Gradle property.
useLegacyPackaging
option can help to reduce your final .apk
file size, it is important to be aware of the side effects of changing this setting and to test your application to understand how it will behave.
build.gradle(.kts)
file, add an ndk
block inside the defaultConfig
block like so:
x86*
ABIs) are rare nowadays, but Chromebooks often have these types of CPUs.
For more details about this ndk.abiFilters
configuration, see Generate Code for a specific ABI.
splits
block to your app’s build.gradle(.kts)
file inside the android
block.
include
configuration. You may remove any ABIs that your environment doesn’t need.
For more details see about the splits.abi
Gradle configuration, see Configure multiple APKs for ABIs.
Note that the Google Play Store requires each APK you publish to have a unique versionCode
. Check with your MDM system’s requirements as to what their app versioning policies are. A strategy for generating a unique versionCode
for each APK is detailed in the Build multiple APKs guide. For more information about this topic, see Assigning version codes.