0
Build completed with a result of 'Failed' in 28 seconds (28474 ms)  #0 GetStacktrace(int)
#1 DebugStringToFile(DebugStringToFileData const&)
#2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
#3  (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object) 
#4  (Mono JIT Code) [BuildPlayerWindowBuildMethods.cs:95] UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
#5  (Mono JIT Code) [BuildPlayerWindow.cs:1172] UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform,UnityEditor.Modules.IBuildPostprocessor)

It says

FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':launcher:checkDebugDuplicateClasses'.
    > 1 exception was raised by workers:
      java.lang.RuntimeException: java.lang.RuntimeException:
      Duplicate class com.unity3d.ads.BuildConfig found in modules UnityAds-runtime.jar (:UnityAds:) and com.unity3d.ads.unity-ads-4.4.1-runtime.jar (:com.unity3d.ads.unity-ads-4.4.1:)
      Duplicate class com.unity3d.ads.IUnityAdsInitializationListener found in modules UnityAds-runtime.jar (:UnityAds:) and com.unity3d.ads.unity-ads-4.4.1-runtime.jar (:com.unity3d.ads.unity-ads-4.4.1:)

I searched up the problem, and I figured it out that it was because my Unity Ads package was duplicated. But I can't figure out how to remove only one of the duplicates.

BTW, it worked perfectly before adding a keystroke.

WarrenFaith
  • 57,492
  • 25
  • 134
  • 150
Octopus
  • 17
  • 2

2 Answers2

0

maybe try to disable the unity ads services or uninstall the package via package manager

Okabim
  • 11
  • It will just give another error saying it was not found. – Octopus Nov 29 '22 at 13:43
  • I managed to solve it the way you see in my answer. – Octopus Nov 29 '22 at 19:31
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 04 '22 at 17:35
0

I managed to fix it by clicking Assets/Mobile Dependency Resolver/Android resolver/Delete Resolved Libraries

And then I build again.

Octopus
  • 17
  • 2