Apk size over 100mb, a solution that feat well for both play store and private store?

357 Views Asked by At

I have a problem with apk size, because I need to import two heavy libraries for certain users (the server decides which user need the libraries).

The final apk is published on the play store but also on a private company store.

Initially I thought to resolve this problem using the app bundles and feature, but this solution creates problem on private store, because I can't publish and app bundles on private store (or i'm wrong ? I will be happy in case)

Now I think to apk extension, I could put in the extension the heavy libraries and download they only if the user need the library ? But the most important question is: can I upload the apk extension also on private store ?

2

There are 2 best solutions below

0
Mike On

Depending on the private store, if it supports .aab upload or even the signing similar to what Google Play offers. Most likely it doesn't (might be soon supported to some stores e.g. Huawei App Gallery).

If you are looking to save up your apk size you can look up on Obfuscation and Shrinking your app https://developer.android.com/studio/build/shrink-code

If you are using native library, you can look up abi splits https://developer.android.com/studio/build/configure-apk-splits

2
Pierre On

If the size of the APK is not an issue on other stores, I'd recommend to use the AAB, and generate (using bundletool) a universal APK for stores that don't support AAB.

But as Mike mentioned in an other answer, it's probably worth ensuring that you've also shrunk code and resources.