MohanRaj
MohanRaj

Reputation: 662

APK Size increased dramatically with appcompat-v7:23.4.0

My APK size was around 11 MB last week with appcompat-v7:23.2.0.

Last week I've updated my SDK and changed my App compact version in gradle file eventually from 23.2.0 to 23.4.0 and all of a sudden my APK size gone up to 20 MB.

I've unzipped both APK's and found that drawable files of V4 has been increased with my latest APK.

With 23.2.0

With 23.2.0

With 23.4.0

enter image description here

Is there is any way around to reduce the size ofAPK?

EDIT 1:

FYI : I have added following code in my gradle.

buildTypes { release { minifyEnabled true shrinkResources true } }

Upvotes: 1

Views: 500

Answers (1)

Rosário P. Fernandes
Rosário P. Fernandes

Reputation: 11326

Add this code to your gradle.build file inside your app module.

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

The skrinkResources will remove unused drawables.

Upvotes: 1

Related Questions