How to use the ProGuard in Android Studio?

Felipe Porge Xavier picture Felipe Porge Xavier · Jan 2, 2014 · Viewed 139.1k times · Source

This is my first project in Android Studio, and the code of my apps are not obfuscated. Im using this configuration in build.gradle file: enter image description here

I'm using the Build > Generate Signed APK... with the Run Proguard checked. And, when I have tested using the Apk_OneClick.v4.2, my code is completly easy to read:

enter image description here

Please, help-me. :(

Answer

Scott Barta picture Scott Barta · Jan 2, 2014

You're probably not actually signing the release build of the APK via the signing wizard. You can either build the release APK from the command line with the command:

./gradlew assembleRelease

or you can choose the release variant from the Build Variants view and build it from the GUI:

IDE main window showing Build Variants