Reputation: 1047
I am trying to enable minifying in an Android app using ProGuard.
When I set minifyEnabled
to false
it builds but as soon as I set it to true
:
buildTypes {
debug {
minifyEnabled false
jniDebuggable true
versionNameSuffix '_DEBUG'
zipAlignEnabled true
}
release {
minifyEnabled true
proguardFile getDefaultDexGuardFile('dexguard-release.pro')
proguardFile 'dexguard-project.txt'
jniDebuggable false
signingConfig signingConfigs.release
}
I get a gradle syncing error:
ERROR: minifyEnabled is set to 'true' for variant <name of the variant>.
And stacktrace states:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring project ':MainApp'
Caused by: org.gradle.api.GradleException: Errors occurred during DexGuard plugin configuration.
What does DexGuard have to do here?
Upvotes: 0
Views: 938
Reputation: 384
Dexguard's documentation says:
DexGuard expects its inputs to be unobfuscated, so make sure none of the variants you specify here have the minifyEnabled options set to true.
You can't use both Dexugard and Proguard in the same library. You have to either disable Dexguard or Proguard.
Dexguard is an improved (and paid) version of Progurad. I don't see any reason for using Proguard when you have Dexguard.
Upvotes: 3