Lean and Fast - How to shrink down and lean down Android apps


Despite previous advice - do not use zopfli for alternative compression


If the images were manually optimized - turn off the cruncher. You can do zopli compression on the images unlike on the apps Use WebP (but support is only available since Android 4.0)

// Gradle Plugin 2.0+
    defaultconfig {
        vectorDrawables.useSupportLibrary = true

Use Proguard

Use proguard. It is tough and things break but it is worth it.

This configuration though will not use full blown ProGuard but use a built in simplified shrinker.

minifyEnabled true
useProguard false   

use @Keep annotation in code to generate ProGuard rules automatically during the build process

Open sourced tool ClassyShark