Reputation: 4023
In my app I am using a set of native library .And those library are available for different CPU architecture. But the problem is all those library are taking almost 87% of the apk size .
I want to reduce apk size for downloading, hence I want make conditional apk based of CPU architecture. How can I do it ?
Upvotes: 1
Views: 362
Reputation: 2664
Use AbiSplitOptions.
Example:
android {
...
splits {
// Configures multiple APKs based on ABI.
abi {
// Enables building multiple APKs.
enable true
// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86, armeabi-v7a, and mips.
reset()
// Specifies a list of ABIs that Gradle should create APKs for.
include "x86", "armeabi-v7a", "mips"
// Specify that we want to also generate a universal APK that includes all ABIs.
universalApk true
}
}
}
Upvotes: 2