Reducing APK size
By @psh:
[...] I ran a couple of tests and the size is largely due to binary files included by mapbox - I suggest adding
android {
...
splits {
abi {
enable true
universalApk false
}
}
}
so that our build generates separate APK files for the different processor types that mapbox binaries are targeting. Each is only 8.7Mb in size! Adding this would mean uploading the 7 generated APK files when you release the app, but it would be a huge boon to users on limited data connections.
I agree that APK size is a very important thing as many of our users inhabit places where network and WiFi connections are rare, and data rates expensive. I would even say that they are our most important users, because they inhabit places that have very few Commons images.
Having several APKs may be bothersome to upload, but that can be solved by using a Google Play upload script. If someone could investigate this matter that would be great :-)
#710 - but i'm fine with closing the older one in favor of this because it seems to describe the issue better.
EDIT: closed it.
Yes sure. https://developer.android.com/topic/performance/reduce-apk-size.html
I tested the above mentioned code and 7 apk were generated. I had some doubt that whether we need to upload only one apk or more than one ? I came across some python script for same.
With the recent version of the app (v4.1.0) the APK size has increase a bit more. This seems due to the switch from MapBox to MapLibre which is clearly adding 20MB in total to the universal APK. Approx. 5MB for each arch.
Below is a screenshot of the APK comparison b/w v4.0.5 and v4.1.0 releases:
We should check if there's anything that could be done to reduce this. @kartikaykaushik14 Do you happen to have any ideas on what could be done about this ?
@sivaraam I'll try to analyze the dependencies and check if any unnecessary ones are added due to MapLibre.
As OP says, why not ABI split? :)