I'm getting this error when building gradle.
What went wrong: Execution failed for task ':transformClassesWithJarMergingForRelease'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/common/util/VisibleForTesting.class
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
I will solve this problem if I can see which modules are conflicting. Any help appreciated!
Because this happened to me and I was stuck trying to figure this one out myself. You can copy the gradle command from the error message in Unity and execute gradle yourself.
Copy the command from the "CommandInvokationFailure: Gradle build failed." error message in the Unity console, in my case:
Open a terminal and navigate to \Temp\gradleOut\
Add --stacktrace on the command above:
If you open up the Player Settings you'll find logging options (on the bottom). The logging options apply to all build targets, they are influencing the stacktrace.
The default setting is Script Only which only outputs the managed stacktrace. If you set it to "full" you'll also get the native stacktrace, which might help in your case.
https://docs.unity3d.com/ScriptReference/StackTraceLogType.html