Closed yashashri10 closed 5 years ago
Hey @yashashri10
The plugin holds 32 bit and 64 bit architectures for 3 types of CPUs. You can shrink the apk by building your app only for arm and x86. This article mentions why some architectures are unnecessary. It also has steps on how to further reduce apk size (But I don't recommend those).
Refer issue #8 if you get stuck while following the below steps.
ndk {
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
It will look like this in your apps build.gradle.
defaultConfig {
versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
applicationId privateHelpers.extractStringFromManifest("package")
if (cdvMinSdkVersion != null) {
minSdkVersion cdvMinSdkVersion
}
ndk {
abiFilters "armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64"
}
}
arm64-v8a & x86_64 architectures are 64 bit architectures and you probably need to include this if you want to be a hit on the playstore. If it is a single device apk you can further strip the architectures down to the only one required by your device. We have removed the mips 32 bit and 64 bit architectures by doing this.
Let me know if you need more help.
@ChrisTomAlex Thank you for reply. I will integrate it and get back to you. :)
Hi,
The android apk generated in the demo link https://github.com/jhansireddy/AndroidScannerDemo/tree/master/ScanDemoExample/apk is just 5.4 MB. Can you explain the reason for the drastic increase(around 40 MB) in apk size after addition of the plugin, which uses the same scan library?
Hey @akhilvenkateswaran If you unzip that apk under the lib folder you will see the only architecture it supports is armeabi-v7a. Compared to that this plugin supports 7 architectures. You can use the solution I provided above to choose which architectures you want to support
I have installed plugin in ionic project. Functionality working fine but apk size increases. Previously before adding plugin apk size is just 15 MB but after installing this plugin apk size increases upto 60MB.
Please need help.