I am using Android Studio version v2.1.2
and Proguard
doesn't work when I try to sign the release build, the build fails dramatically.
According to this link from developer docs Jack does obfuscation automatically.
Handles shrinking, obfuscation, repackaging and multidex Using a separate package such as ProGuard is no longer necessary.
I had to disable minifyEnabled
flag and remove the line where we load proguard file; to get it working, after doing this; I inspected the apk
file generated by doing the above and I cannot tell whether Jack really obfuscated and reduced redundant code as the release apk
size is same as the debug apk
size.
I need to understand how to make obfuscation work with the newer compiler as the documentation doesn't really help.
I am looking forward to understand the following questions.
Does Jack
work without Proguard
file?
Is there a way to specify Proguard
file?
The Jack compiler has its own Shrinker and Obfuscator that re-uses existing Proguard rules (see supported directives).
The configuration should be the same as before, so you need to add the following to your buildType configuration: