Since our SDK contains NDK code, it must be built individually for all CPU architectures to satisfy each ABI type. As a result, adding the SDK to your project may have the unintended consequence of drastically increasing your APK size. Below are a couple of steps you can take to mitigate a significant portion of this increase.
Applying ABI filters
If you know that you will not need to support certain CPU types, you can filter them out in your app's build.gradle file. To do so, add the following block within the defaultConfig:
ndk {
abiFilters 'x86', 'x86_64' // Do not build for x86 & x86_64 CPUs
}
Doing this for all CPU architectures you do not wish to support can greatly reduce the size of the SDK's files.
Do not extract native libraries
Another step you can take to reduce the size of the SDK is to set the following attribute in your AndroidManifest.xml:
<application
extractNativeLibs='false'
More information on this setting can be found here.