We have a native library (.so) which is about 2 MB for each Architecture(‘x86’, ‘x86_64’, ‘armeabi-v7a’, ‘arm64-v8a’). Using this Native library we have written an SDK which is going to be integrated with Android App (distributed as ‘aar’ files).
In our sample app when integrated with the SDK and hosted on google play store, it shows the download size to be 14 MB (which is roughly correct if we have all the 4 native libraries inside the APK).
But each device support multiple architectures, this solution doesn’t work for us. Is there a way to make sure that Google play store picks up only one .so files as per the architecture so that it will significantly reducing the size of each APK?
We have tried the following in build.gradle:
android {
... // Configure the splits block
splits {
abi {
enable true // Enable ABI splits
reset() // Reset any previous configurations
include 'armeabi', 'armeabi-v7a', 'x86', 'mips' // Specify the ABIs you want to include
universalApk false // If true, also generate a universal APK that includes all ABIs
}
}
}
Explanation: enable true: Enables ABI splits. reset(): Clears any previous ABI configurations. include ‘armeabi’, ‘armeabi-v7a’, ‘x86’, ‘mips’: Specifies the ABIs you want to include in your splits. universalApk false: Disables the creation of a universal APK that includes all ABIs. But each device support multiple architectures, this solution doesn’t work for us.