Unity 2020.1.0a3 Build fail - Gradle error message

Good afternoon,
I’m posting my question here because I couldn’t find any answer on Unity forums and searching my error message en Google gave returned my own question in Unity Forums.
Here is my problem :
I have to upgrade an existing and published application ( Dice for Heroquest – Applications sur Google Play to 64bits as required by Google Play

I had a lot of issues converting my project at all levels (Unity version, Android SDK and NDK, IL2CPP…) but finally, after updating all these (via UnityHub), I now have a building error related to Gradle (which I know nothing about).

Here is the report from Unity :
CommandInvokationFailure: Gradle build failed.
D:/Unity/2020.1.0a3/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath “D:\Unity\2020.1.0a3\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “bundleRelease”

stderr[

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ‘:launcher:checkReleaseDuplicateClasses’.

1 exception was raised by workers:
java.lang.RuntimeException: Duplicate class com.google.games.bridge.BuildConfig found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)
Duplicate class com.google.games.bridge.NativeBridgeActivity found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)
Duplicate class com.google.games.bridge.TokenFragment found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)
Duplicate class com.google.games.bridge.TokenFragment$1 found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)
Duplicate class com.google.games.bridge.TokenFragment$1$1 found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)
Duplicate class com.google.games.bridge.TokenFragment$2 found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)
Duplicate class com.google.games.bridge.TokenFragment$3 found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)
Duplicate class com.google.games.bridge.TokenFragment$TokenRequest found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)
Duplicate class com.google.games.bridge.TokenPendingResult found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)
Duplicate class com.google.games.bridge.TokenResult found in modules classes.jar (:com.google.games.gpgs-plugin-support-0.9.62:) and classes.jar (classes.jar)

Go to the documentation to learn how to Fix dependency resolution errors.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 16s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[

Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:preBuild UP-TO-DATE
Task :unityLibrary:GooglePlayGamesManifest.plugin:preBuild UP-TO-DATE
Task :launcher:preBuild UP-TO-DATE
Task :unityLibrary:preBuild UP-TO-DATE
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:preReleaseBuild UP-TO-DATE
Task :unityLibrary:GooglePlayGamesManifest.plugin:preReleaseBuild UP-TO-DATE
Task :unityLibrary:preReleaseBuild UP-TO-DATE
Task :unityLibrary:checkReleaseManifest UP-TO-DATE
Task :launcher:prepareLintJar UP-TO-DATE
Task :unityLibrary:GooglePlayGamesManifest.plugin:checkReleaseManifest
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:checkReleaseManifest
Task :unityLibrary:processReleaseManifest
Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseResValues UP-TO-DATE
Task :unityLibrary:mergeReleaseShaders UP-TO-DATE
Task :unityLibrary:compileReleaseShaders UP-TO-DATE
Task :unityLibrary:generateReleaseAssets UP-TO-DATE
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:processReleaseManifest
Task :unityLibrary:GooglePlayGamesManifest.plugin:processReleaseManifest
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:packageReleaseRenderscript NO-SOURCE
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:generateReleaseResValues
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:generateReleaseResources
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseResValues
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseResources
Task :unityLibrary:GooglePlayGamesManifest.plugin:packageReleaseResources
Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeReleaseShaders
Task :unityLibrary:GooglePlayGamesManifest.plugin:compileReleaseShaders
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseAssets
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:packageReleaseResources
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:mergeReleaseShaders
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:compileReleaseShaders
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:generateReleaseAssets
Task :unityLibrary:GooglePlayGamesManifest.plugin:packageReleaseAssets
Task :unityLibrary:GooglePlayGamesManifest.plugin:compileReleaseAidl NO-SOURCE
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:packageReleaseAssets
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:compileReleaseAidl NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseRFile
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseBuildConfig
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:generateReleaseRFile
Task :unityLibrary:GooglePlayGamesManifest.plugin:prepareLintJar UP-TO-DATE
Task :unityLibrary:GooglePlayGamesManifest.plugin:generateReleaseSources
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:generateReleaseBuildConfig
Task :unityLibrary:GooglePlayGamesManifest.plugin:javaPreCompileRelease
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:prepareLintJar UP-TO-DATE
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:generateReleaseSources
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:javaPreCompileRelease
Task :unityLibrary:packageReleaseAssets
Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
Task :unityLibrary:generateReleaseResources UP-TO-DATE
Task :unityLibrary:packageReleaseResources UP-TO-DATE
Task :unityLibrary:compileReleaseAidl NO-SOURCE
Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
Task :launcher:preReleaseBuild
Task :launcher:compileReleaseRenderscript NO-SOURCE
Task :launcher:generateReleaseResValues UP-TO-DATE
Task :launcher:generateReleaseResources UP-TO-DATE
Task :unityLibrary:generateReleaseRFile
Task :unityLibrary:prepareLintJar UP-TO-DATE
Task :unityLibrary:generateReleaseSources UP-TO-DATE
Task :unityLibrary:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:compileReleaseJavaWithJavac
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:compileReleaseJavaWithJavac
Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleLibCompileRelease
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:bundleLibCompileRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleLibRuntimeRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:bundleLibRuntimeRelease
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:processReleaseJavaRes NO-SOURCE
Task :unityLibrary:GooglePlayGamesManifest.plugin:bundleLibResRelease
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:bundleLibResRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:mergeReleaseJniLibFolders
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:mergeReleaseJniLibFolders
Task :unityLibrary:GooglePlayGamesManifest.plugin:transformNativeLibsWithMergeJniLibsForRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:transformNativeLibsWithStripDebugSymbolForRelease
Task :unityLibrary:GooglePlayGamesManifest.plugin:transformNativeLibsWithIntermediateJniLibsForRelease
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:transformNativeLibsWithMergeJniLibsForRelease
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:transformNativeLibsWithStripDebugSymbolForRelease
Task :unityLibrary:com.google.games.gpgs-plugin-support-0.9.62:transformNativeLibsWithIntermediateJniLibsForRelease
Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
Task :unityLibrary:javaPreCompileRelease
Task :unityLibrary:compileReleaseJavaWithJavac
Task :unityLibrary:bundleLibCompileRelease UP-TO-DATE
Task :unityLibrary:bundleLibRuntimeRelease
Task :unityLibrary:bundleLibResRelease UP-TO-DATE
Task :launcher:mergeReleaseResources
Task :launcher:checkReleaseManifest UP-TO-DATE
Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
Task :launcher:mainApkListPersistenceRelease UP-TO-DATE
Task :launcher:processReleaseManifest
Task :unityLibrary:transformNativeLibsWithMergeJniLibsForRelease
Task :unityLibrary:transformNativeLibsWithStripDebugSymbolForRelease UP-TO-DATE
Task :unityLibrary:transformNativeLibsWithIntermediateJniLibsForRelease UP-TO-DATE
Task :launcher:bundleReleaseResources
Task :launcher:mergeReleaseShaders UP-TO-DATE
Task :launcher:compileReleaseShaders UP-TO-DATE
Task :launcher:generateReleaseAssets UP-TO-DATE
Task :launcher:mergeReleaseAssets
Task :launcher:checkReleaseDuplicateClasses FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use ‘–warning-mode all’ to show the individual deprecation warnings.
See https://docs.gradle.org/5.1.1/userguide/command_line_interface.html#sec:command_line_warnings
70 actionable tasks: 49 executed, 21 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <4870ca009482433dbc8444c5f62e8357>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <4870ca009482433dbc8444c5f62e8357>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <4870ca009482433dbc8444c5f62e8357>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <4870ca009482433dbc8444c5f62e8357>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action1[T] progress) (at <4870ca009482433dbc8444c5f62e8357>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <4870ca009482433dbc8444c5f62e8357>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <4870ca009482433dbc8444c5f62e8357>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <4870ca009482433dbc8444c5f62e8357>:0)
Rethrow as BuildFailedException: Exception of type ‘UnityEditor.Build.BuildFailedException’ was thrown.
UnityEditor.Android.PostProcessor.CancelPostProcess.AbortBuild (System.String title, System.String message, System.Exception ex) (at <4870ca009482433dbc8444c5f62e8357>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <4870ca009482433dbc8444c5f62e8357>:0)
UnityEditor.Android.PostProcessAndroidPlayer.PostProcess (UnityEditor.BuildTarget target, System.String stagingAreaData, System.String stagingArea, System.String playerPackage, System.String installPath, System.String companyName, System.String productName, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <4870ca009482433dbc8444c5f62e8357>:0)
UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <4870ca009482433dbc8444c5f62e8357>:0)
UnityEditor.PostprocessBuildPlayer.Postprocess (UnityEditor.BuildTargetGroup targetGroup, UnityEditor.BuildTarget target, System.String installPath, System.String companyName, System.String productName, System.Int32 width, System.Int32 height, UnityEditor.BuildOptions options, UnityEditor.RuntimeClassRegistry usedClassRegistry, UnityEditor.Build.Reporting.BuildReport report) (at <5bab1a3ac70c4024afd9bc9427b3a6a7>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

If anybody could help me please, i would be very grateful !

I’m having the same issue, did you find the solution? can you share?

Thanks

Same here. Please, need help.

Hello , I see that it is about two years now from this post , but I am in your situation now. It is been 5 days now and i looked at all the posts in internet and unity forums etc but now i cannot find a way out of it
:slight_smile: i am crying lol, did you find a solution to this?