Reputation: 662
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.4.0
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
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