My main goal is to remove unused assets and libraries from the apk so that I can reduce it's size. I found Resource Shrinking while I was browsing through this SO post.
So I changed my gradle file to this:
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId 'com.galleri5.android'
multiDexEnabled true
minSdkVersion 16
targetSdkVersion 23
versionCode 12
versionName "0.10"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
And to check whether this was working, I generated the apk and the size of the apk was same as before, no shrinking. So I tried to see if/which resources are being removed by running this command:
./gradlew clean assembleDebug --info | grep "Skipped unused resource"
And this is the output that I am getting:
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
I don't see and resources that are getting removed. Is there something I have done wrong or am I totally misunderstanding this tool? Any help would be highly appreciated. Thanks.
Edit I am just checking the size of the apk(apk-debug.apk) generated after running the app with above configuration. Does shrinking happen when I generate signed apk or would it be visible in the normal apk too?