This section describes some issues that you might encounter when trying to use R8. You might also find details about your issue in the Android Studio User Guide, the R8 Compatibility FAQ, or ProGuard’s Troubleshooting page.
If you cannot find a solution to your problem, or if you otherwise encounter incorrect behavior, you can report a bug with the Google team.
ProGuard appears to be running instead of R8
Make sure that you do not have android.enableR8=false
in your gradle.properties
file.
Note: If you are using a version of the Android Gradle Plugin prior to 3.4, you will need to set
android.enableR8=true
in yourgradle.properties
file to enable R8.
D8: Unsupported option: -skipnonpubliclibraryclasses
This rule is unsupported in R8. Remove it from your configuration.
Custom rules don’t appear to be used
Make sure that any rule file that you want to use is properly configured in your Gradle build script with proguardFiles
. Relative paths configured in your Gradle build script should be relative to the application or library module for which you would like the rules to apply. See the Android Studio User Guide for details.
Note: The Android Gradle Plugin will not error or warn you if it cannot locate the specified file.
The rule [some rule] uses extends but actually matches implements
R8 issues this warning if you use an extends
rule to match descendents of an interface rather than implements
, regardless of whether the descendents you’re trying to match are classes or interfaces. If the specified rule is a custom rule that you have created, you can update the rule to use implements
rather than extends
. However, some libraries, including Android support libraries, contain rules that will produce this warning. Unfortunately, there is no easy way to resolve or suppress the warning in that case.