3 Steps to Fix Gradle Build Failure with android.enableR8 Warning



how to resolve the error : WARNING: The option 'android.enableR8' is deprecated and should not be used anymore. It will be removed in a future version of the Android Gradle plugin, and will no longer allow you to disable R8.

1, Edit -> Player Setting -> Publishing Settings, click "Custom Base Gradle Template" blew the Build section.

2, You will find a "Assets\Plugins\Android\baseProjectTemplate.gradle" file was generated, open it by text editor.

3, change
"classpath 'com.android.tools.build:gradle:3.6.0'"
into
"classpath 'com.android.tools.build:gradle:3.4.0'"


commandinvokationfailure: gradle build failed. unity gradle build failed unity warning: the option setting 'android enabler8 false' is deprecated starting a gradle daemon, 1 incompatible daemon could not be reused unity the option setting 'android.enabler8=false' is deprecated. unity android resconfigs execution failed for task ':launcher:checkreleaseduplicateclasses execution failed for task ':unitylibrary:compilereleasejavawithjavac'.