How to Reduce APK size in Android Studio

How to Reduce APK size in Android Studio


In this article we will learn that how to reduce the APK size in Android. To download any application (APK file) from the play store, if that application is too large then obviously, you will not download that application. In today’s world, everyone needs an application which is smaller so it is important to reduce the APK size.

In this whole process we need to some changing in our build.gradle(Module:app) and Proguard-rules.pro so please following all the step by step.



Please check screenshot for build.gradle changing.




Step 1: build.gradle
android {

    buildTypes {
        release {
            minifyEnabled true
            shrinkResources true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

Please check screen shot of changing in Proguard-rules.pro.





Step2 1: Proguard-rules.pro

-keeppackagenames org.jsoup.nodes
-dontwarn com.squareup.okhttp.**

Share:

0 comments

Please leave your comments...... Thanks