How to resolve multiple D8 warnings: <Class X> was not found, it is required for default or static interface methods desugaring <Class Y>?

Update: the issue has been fixed in Android Gradle Plugin 3.5.0-beta05 (see issue: Ability to selectively suppress warnings during D8 desugaring).


For Android Gradle Plugins 3.2.1 - 3.4.1 use the following workarounds:

From Android Gradle plugin 3.2.1 changelog:

Desugaring with D8 is now enabled by default.

So you should disable desugaring with D8 (in project's gradle.properties file):

android.enableD8.desugaring=false

If you use R8:

R8 is a new tool for code shrinking and obfuscation that replaces ProGuard. You can start using the preview version of R8 by including the following in your project’s gradle.properties file:

android.enableR8 = true

disable desugaring with R8 (in project's gradle.properties file):

android.enableR8.desugaring=false