After upgrading to Android Gradle plugin 3.4.0, a basic class no longer gets obfuscated.
The following basic steps can reproduce the problem:
Try to set useProguard false
to let the plugin use R8 instead of ProGuard to shrink and obfuscate your app’s code and resources. E.g.
android {
...
buildTypes {
debug {
minifyEnabled true
useProguard false
}
release {
minifyEnabled true
useProguard false
}
}
}
Or alternatively, if you want to stick to ProGuard, you should disable R8 from gradle.properties
like below:
# Disables R8 for Android Library modules only.
android.enableR8.libraries = false
# Disables R8 for all modules.
android.enableR8 = false
And remember to set useProguard true
.
Edit #1
Check here for how to migrate Proguard to R8: Android/java: Transition / Migration from ProGuard to R8?