When i run my app size of apk will 21 MB. even i enabled proguard. i use android studio to run project. in project files src folder has 8.62 MB size and lib folder size is 4
These 4 things reduce your apk size almost 50-60%
proguard-android.txt with proguard-android-optimize.txtminifyEnabled trueshrinkResources trueAdd resConfigs
buildTypes {
release {
minifyEnabled true
shrinkResources true
resConfigs "en"
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
Details:
proguard-android-optimize.txt is the more aggressive progurard configuration than proguard-android.txt.
shrinkResources attribute will remove all the resources, those are not used anywhere in the project.
resConfigs attribute will remove all the other localized resources while building the application. Here, it strips other than english resources.