I am trying to run proguard on my app which includes Unity 3D. Currently proguard fails trying to process unity-classes.jar, and the only workaround is to build proguard myself with a patch applied (see this link for the bug report).
So, I have my own custom proguard.jar now, but how can I get the android plugin to use it? With eclipse this was just a matter of replacing proguard.jar in the Android SDK directory, but this doesn't work anymore with Android Studio/Gradle. In fact, I can delete the proguard files from tools/proguard/lib/, and it still runs!
How can I get Android Studio/Gradle to use my custom built proguard.jar?
I solved this by placing the custom proguard.jar in a directory named "proguard" in the root folder (not project root folder) and setup the gradle file like this:
buildscript {
repositories {
flatDir { dirs 'proguard' }
mavenCentral()
}
dependencies {
classpath 'proguard.io:proguard:5.0'
classpath 'com.android.tools.build:gradle:0.12.+'
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With