I use Android Studio 3.3 Canary 5, Gradle 4.9, gradle plugin 3.3.0-alpha05
minifyEnabled true useProguard false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
Does't work.
Edit:
@JakeWharton: "You use ProGuard configurations for this, not a Gradle DSL. Disable shrinking with -dontshrink, disable obfuscation with -dontobfuscate, and disable optimization with -dontoptimize."
proguard-rules.pro
-dontshrink -dontobfuscate -dontoptimize
Enable shrinking, obfuscation, and optimization 0 and higher, R8 is the default compiler that converts your project's Java bytecode into the DEX format that runs on the Android platform. However, when you create a new project using Android Studio, shrinking, obfuscation, and code optimization is not enabled by default.
In Android Studio 3.4, R8 is used by default for all projects that don't disable it. You can switch to Proguard with: android.
R8 is having a faster processing time than Proguard which reduces build time. R8 gives better output results than Proguard. R8 reduces the app size by 10 % whereas Proguard reduces app size by 8.5 %. The android app having a Gradle plugin above 3.4.
In your gradle.properties
file, add this line
android.enableR8=false
This worked for me.
Following this answer, I was able to solve this issue. Instead of editing the build.gradle
file, I added -dontobfuscate
to the proguard-rules.pro
file. (You can configure a different proguard
rules file for debug and release builds.) This skipped the obfuscation step and allowed me to make shrink'd debug builds with R8.
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