Enabling R8
The DashOâ„¢ Gradle Plugin for Android delegates renaming and removal to R8; to fully protect your app it is essential that you enable R8 alongside the plugin. This involves both setting R8 as the shrinker for your project (if needed) and enabling shrinking on your application for the build types that you want to protect.
In version 3.4 and later of the Android Gradle Plugin, R8 is set as the shrinker by default.
When using version 3.3 of the Android Gradle Plugin or earlier, add the following statement to the gradle.properties
file alongside your root build.gradle
:
android.enableR8=true
To enable shrinking on a build type, use the minifyEnabled
property in your project's build.gradle
:
android {
buildTypes {
release {
minifyEnabled true
}
}
}