Gradle Build Failed - versionCode Issue?

I updated Unity and am now receiving this error when I build to Android. I tried going back to the previous version, but I now receive the error there as well. I’m attempting to build version 2, so I don’t really understand why the error is saying “android.defaultConfig.versionCode is set to 0, but it should be a positive integer.” I’ve been trying to troubleshoot this for a few days with no luck, any help would be much appreciated…

Build Specs:
Unity Version: 2019.1.8f1
Min Api: 16
Target Api: 28
Scripting Runtime Version: .NET 4.x
Scripting Backend: IL2CPP
Target Architechtures: ARMv7, ARM64 (building for play store)

Attached is a screenshot of the console window.

Console Message:
CommandInvokationFailure: Gradle build failed.
C:\Program Files\Unity\Hub\Editor\2019.1.8f1\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath “C:\Program Files\Unity\Hub\Editor\2019.1.8f1\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:
    A problem occurred configuring root project ‘gradleOut’.

android.defaultConfig.versionCode is set to 0, but it should be a positive integer.
See Uygulamanıza sürüm oluşturma  |  Android Studio  |  Android Developers for more information.

  • 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 4s
    ]
    stdout[
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <1a10f9035b6b403994c99e5b653643c6>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action1[T] progress) (at <1a10f9035b6b403994c99e5b653643c6>: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 <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>: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 <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <1a10f9035b6b403994c99e5b653643c6>: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 <1a10f9035b6b403994c99e5b653643c6>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <1a10f9035b6b403994c99e5b653643c6>: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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

Do you have a custom build.gradle file? The template has probably changed in Unity 2019.1.8f1 compared to your previously used Unity version. Try to recreate the build.gradle based on the template in 2019.1.8f1.

Hey @JuliusM thanks for the reply.

I was not using a custom build.gradle (I honestly don’t even know how). I did manage to get things working, but I have a feeling it is not best practice. I went into mainTemplate.gradle located in \Assets\Plugins\Android and changed versionCode to a hardcoded number. I also removed the Unity default message at the top of the file so it wouldn’t get overwritten on build. After I did this, the project built successfully.

Advice on moving forward? I’d really not like to hardcode the version in the gradle every time I build the project.

EDIT: I also noticed there was a mainTemplate.gradle.DISABLED file in the same folder. It contains all the maven plugin data related to the various ad networks I’m using via Admob mediation. None of this data is in the other gradle file. Not sure if that is pertinent, but thought it could be.

Sorry, when I’ve said build.gradle file, I actually meant mainTemplate.gradle, which gets converted into build.gradle when building. So you seem to have it in your project. The template tends to change with new Unity versions since we are changing used gradle and gradle plugin versions from time to time and that requires to do modifications in template files as well. So when using a custom template, the best thing to do on the project upgrade to a new Unity version is to see if the template has changed in that Unity version and if it did change, then to adapt your template changes on top of “the new” template.
In general to see the base template used by a specific Unity version you would enable the “Custom Gradle Template” checkbox in Player Settings → Publishing Settings which will create a Assets/Plugins/Android/mainTemplate.gradle file. Disabling this checkbox would rename mainTemplate.gradle to mainTemplate.gradle.DISABLED to preserve any changes that were potentially done. So in “proper” project setup after upgrading the project to a new Unity version you could move Assets/Plugins/Android/mainTemplate.gradle file somewhere else, then create appropriate mainTemplate.gradle by enabling the checkbox in Publishing Settings. And finally doing same modifications that were done in a previous template to the new one.
I don’t know how your project was set up, but having both mainTemplate.gradle and mainTemplate.gradle.DISABLED sounds strange, especially since “.DISABLED” variant seems to have useful changes. If your project compiles and runs fine and ads work, you can probably remove that “.DISABLED” file, but better make a backup.
Your original issue seems to be related to this Unity Issue Tracker - [Android] Android manifest contains incorrect values for platformBuildVersionCode and platformBuildVersionName which was fixed in 2019.1.7f1, so updating the template was probably what you were missing. I’d recommend to do that instead of hardcoding values (at least in the future upgrades).

Welp, turns out my solution didn’t work afterall. The build succeeded, but the app crashes immediately upon loading. I’ll hop over to the thread you linked and see if I can get it working from there. Thanks!

No luck on the solution from the other thread. I went ahead and upgraded a copied version of the project to 2019.2.14f1 and built the project again. Below is the log. Very similar to before, but you’ll note the “assembleRelease” instead of “bundleRelease”. I unchecked the custom gradle to generate this. Back to square one it seems…

CommandInvokationFailure: Gradle build failed.
C:/Program Files/Unity/Hub/Editor/2019.2.14f1/Editor/Data/PlaybackEngines/AndroidPlayer/Tools\OpenJDK\Windows\bin\java.exe -classpath “C:\Program Files\Unity\Hub\Editor\2019.2.14f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”
stderr[
FAILURE: Build failed with an exception.

  • What went wrong:
    A problem occurred configuring root project ‘gradleOut’.

android.defaultConfig.versionCode is set to 0, but it should be a positive integer.
See Uygulamanıza sürüm oluşturma  |  Android Studio  |  Android Developers for more information.

  • 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 2s
    ]
    stdout[
    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <21da158cd428404389e0b5a08ba9ea0a>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <21da158cd428404389e0b5a08ba9ea0a>:0)
    UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <21da158cd428404389e0b5a08ba9ea0a>:0)
    UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action1[T] progress, System.String error) (at <21da158cd428404389e0b5a08ba9ea0a>:0) UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action1[T] progress) (at <21da158cd428404389e0b5a08ba9ea0a>: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 <21da158cd428404389e0b5a08ba9ea0a>:0)
    UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <21da158cd428404389e0b5a08ba9ea0a>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <21da158cd428404389e0b5a08ba9ea0a>: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 <21da158cd428404389e0b5a08ba9ea0a>:0)
    UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <21da158cd428404389e0b5a08ba9ea0a>: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 <21da158cd428404389e0b5a08ba9ea0a>:0)
    UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <21da158cd428404389e0b5a08ba9ea0a>: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 C:/buildslave/unity/build/Editor/Mono/BuildPipeline/PostprocessBuildPlayer.cs:281)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

Welp, I ended up exporting my project to Android Studio, fixing the gradle issues and a few others from there, then built a working version from there instead :frowning: Not ideal, but it works.

[Try Any this]
—> Bundle I’d : increment by one
—>Change package name
—> Remove .gradle cache
C/UserName/UserName/.gradle/cache folder
—> Backup C/UserName/Username/.gradle
Folder after remove it.
—> Backup C:/Username/Username/.android folder
after remove it.

2 Likes

I use Unity2019.3.5f1 in MacOS 10.13.6. The method works for me. Thanks @kpatulrpatel

Using Unity 2019.2.13f1 in Win10 machine - This method worked for me as well. Thanks for the info! =)

what is bundle id and how will i change it?
ı cant find grandle cache

Is this info anywhere except in this forum post? Seems like it’s worth at least a sticky post on “How to Update Unity without breaking your build”.

I’m currently trying to go from Unity 2019.2.0 to the 2019 LTS and facing all this after the fact. Would be awesome to have a proper list of steps

I am facing this problem with no workaround I got the same error from unity 2019 and I have updated to version 2020 still the same error please give me the solution thank everyone

Gradle fails to build and throws the following error:

CommandInvokationFailure: Gradle build failed.

C:\Program Files\Unity\Hub\Editor\2020.1.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath “C:\Program Files\Unity\Hub\Editor\2020.1.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.6.4.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”

stderr[
FAILURE: Build failed with an exception.

  • What went wrong:

A problem occurred configuring project ‘:launcher’.

android.defaultConfig.versionCode is set to 0, but it should be a positive integer.

See Uygulamanıza sürüm oluşturma  |  Android Studio  |  Android Developers for more information.

  • 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 1m 28s
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

Configure project :launcher
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.

]

exit code: 1

UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <5f8140421e7d41ada100b629c3033aa7>:0)

UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <5f8140421e7d41ada100b629c3033aa7>:0)

UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <5f8140421e7d41ada100b629c3033aa7>:0)

UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <5f8140421e7d41ada100b629c3033aa7>:0)

UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, System.String workingdir, System.String task, System.Action`1[T] progress) (at <5f8140421e7d41ada100b629c3033aa7>: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 <5f8140421e7d41ada100b629c3033aa7>:0)

UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5f8140421e7d41ada100b629c3033aa7>:0)

UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5f8140421e7d41ada100b629c3033aa7>: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 <5f8140421e7d41ada100b629c3033aa7>:0)

UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <5f8140421e7d41ada100b629c3033aa7>: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 <5f8140421e7d41ada100b629c3033aa7>:0)

UnityEditor.Android.AndroidBuildPostprocessor.PostProcess (UnityEditor.Modules.BuildPostProcessArgs args, UnityEditor.BuildProperties& outProperties) (at <5f8140421e7d41ada100b629c3033aa7>: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 <3b1af5075b0340cfb428dfcef292b2ea>:0)

UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)
website: gamefre.com

I am facing this problem with no workaround I got the same error from unity 2019.4.10. please give me the solution thank everyone

CommandInvokationFailure: Gradle build failed.
C:/Program Files/Unity/Hub/Editor/2020.1.4f1/Editor/Data/PlaybackEngines/AndroidPlayer/OpenJDK\bin\java.exe -classpath “C:\Program Files\Unity\Hub\Editor\2019.4.10f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.1.1.jar” org.gradle.launcher.GradleMain “-Dorg.gradle.jvmargs=-Xmx4096m” “assembleRelease”

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: java.lang.RuntimeException: Duplicate class com.google.android.gms.common.util.VisibleForTesting found in modules classes.jar (:com.google.android.gms.play-services-basement-17.0.0:) and libGoogleAnalyticsServices.jar (libGoogleAnalyticsServices.jar)
Duplicate class com.google.unity.BuildConfig found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.AdNetworkExtras found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Banner found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Banner$1 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Banner$2 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Banner$3 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Banner$4 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Banner$5 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Banner$6 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Banner$7 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.CustomNativeAd found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.CustomNativeAd$1 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.CustomNativeAd$2 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Interstitial found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Interstitial$1 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Interstitial$1$1 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Interstitial$2 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.Interstitial$3 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.NativeAdLoader found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.NativeAdLoader$1 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.NativeAdLoader$2 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.NativeAdLoader$3 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.NativeAdLoader$3$1 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Duplicate class com.google.unity.ads.NativeAdLoader$3$2 found in modules classes.jar (:googlemobileads-unity:) and unity-plugin-library.jar (unity-plugin-library.jar)
Du

Delete the Temp folder

Under the Unity Project?
Thanks :slight_smile:

Yeah, I thought that was enough, but you might also need to set the Build Version Code to something higher than 0 (under Project Settings → Other Settings). I’m not 100% sure if this is what fixed it for me, but some combination of the two got it going.

1 Like

PlayerSetting->Other Setting->Bundle Version Code
change 0 to 1

2 Likes

For me work too!

PlayerSetting->Other Setting->Bundle Version Code
change 0 to 1

1 Like