Minify android app but do not obfuscate it

minifyEnabled true

is just a shortcut for:

postprocessing {
    removeUnusedCode true
    obfuscate true
    optimizeCode true
}

So, if you want to minify without obfuscating, replace minifyEnabled true with:

postprocessing {
    removeUnusedCode true
    obfuscate false // <--
    optimizeCode true
}

Additionally, the compiler will complain if you have shrinkResources true. The equivalent postprocessing field is removeUnusedResources true, i.e:

postprocessing {
    removeUnusedCode true
    removeUnusedResources true // <--
    obfuscate false
    optimizeCode true
}

Contrary to other answers, useProguard false does not disable obfuscation; it changes the obfuscation engine from ProGuard to R8.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)