Anurag Tiwari
Anurag Tiwari

Reputation: 115

How to minimize the .apk size in android studio?

I am making a simple video call app by using Jitsi Android SDK after completion when i build my signed APK its size is too big i.e, 101 MB when i check that apk it shows the type .nox apk.

Another problem is when i tried to install that 101MB apk into Mobile it says App Not Installed for this i checked mobile settings Unknown Sources after that it stick to the same message (App not installed).

this is my App's build.gradle(app) file

This is My app's Dependencies

Here is my Proguard Rule also and target SDK

enter image description here

and this is the extention of APk file

enter image description here

here is my analyze apk result

enter image description here How to build reduced Apk which run easily...Please Help me into this i don't know where i am going wrong ??

enter image description here

enter image description here

enter image description here

Upvotes: 0

Views: 3550

Answers (3)

Usman Ali
Usman Ali

Reputation: 433

  1. First of All You Need to Tinify the Resource images Tinyfy, I suggest you to use this link to tinify your image assets.

  2. The Second thing after the above Step, Convert all Image Assets to Webp Format, in order to convert to webp you need to right click on image asset and then at the Bottom of option there will be optionj convert to webp.

  3. Remove Unnecessary classes and libraries to Reduce the Size.

  4. Apply Proguard Rules to Reduce Size

  5. In Order to remove delete x86_64 you just need to do is, just add this under Android Tag in app level gradle File

    splits { abi { enable true reset() include 'armeabi-v7a' universalApk false } } Split APk

Upvotes: 0

hardartcore
hardartcore

Reputation: 17037

The main reason for your app to be that big is because of all the native libraries which you have in your project. I guess they are included by Jitsi Android SDK. I guess you are not creating App Bundle but building directly an apk via Android Studio, that's why all versions of native libraries are included in the same apk. By using App Bundle format to build your app you should lower a lot your app's size, because it will create apk files only for the specific configurations, so every architecture will have it's own apk with included native libraries for only that architecture.

Once you have the App Bundle file you can create your apk's in order to install to a device using bundletool. With a command like this:

bundletool build-apks --bundle=/PathToMyABB/app-bundle.aab --output=/PathToMyAPKS/my-apks.apks

Upvotes: 1

I.Yilmaz
I.Yilmaz

Reputation: 49

You can retrieve apk as bundle and convert your images to webp format you are going to save %50 memory area.

Upvotes: 0

Related Questions