title: How to fix in Unity "A failure occurred while executing com.android.build.gradle.internal.tasks.workers$actionfacade"
body: <p>I am working with adMob mediation in Unity. I have integrated inMobi and Unity ads network. After integrating them I am getting the following error &quot;A failure occurred while executing com.android.build.gradle.internal.tasks.workers$actionfacade&quot;. Without integrating inMobi and Unity ads the build is successful. I just don't understand what is the problem</p>
  <p>I looked up to a similar question in Unity forum <a href="https://forum.unity.com/threads/a-failure-occurred-while-executing-com-android-build-gradle-internal-tasks-workers-actionfacade.958112/" rel="nofollow noreferrer">https://forum.unity.com/threads/a-failure-occurred-while-executing-com-android-build-gradle-internal-tasks-workers-actionfacade.958112/</a> and tried solving by correctly entering the password,restarting Unity, creating seperate build file folder,etc but unfortunately nothing is working.</p>
  <p>I saw similar question in stackOverflow, but they were for flutter,Cordova,etc and not Unity<a href="https://i.stack.imgur.com/HOrVX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HOrVX.png" alt="ScreenShot of the error" /></a></p>
  <p>Some of the content of the Editor Log file near the error:</p>
  <pre><code>Note: C:\Users\cheth\FlutteringBirds1\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
  Note: Recompile with -Xlint:deprecation for details.
  D8: Cannot fit requested classes in a single dex file (# methods: 70023 &gt; 65536)
  com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
  The number of method references in a .dex file cannot exceed 64K.
  Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
      at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:132)
      at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:119)
      at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)
      at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:445)
      at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:348)
      at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:50)
      at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:47)
      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:65)
      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:61)
      at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.execute(NoIsolationWorkerFactory.java:61)
      at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
      at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
      at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
      at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
      at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:56)
      at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:215)
      at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:210)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
      at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
      at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
      at com.android.tools.r8.utils.O.a(:65)
      at com.android.tools.r8.D8.run(:11)
      at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:117)
      ... 34 more
  Caused by: com.android.tools.r8.utils.b: Error: null, Cannot fit requested classes in a single dex file (# methods: 70023 &gt; 65536)
      at com.android.tools.r8.utils.y0.a(:21)
      at com.android.tools.r8.dex.K.a(:56)
      at com.android.tools.r8.dex.K$h.a(:5)
      at com.android.tools.r8.dex.b.b(:15)
      at com.android.tools.r8.dex.b.a(:38)
      at com.android.tools.r8.D8.d(:87)
      at com.android.tools.r8.D8.b(:1)
      at com.android.tools.r8.utils.O.a(:30)
      ... 36 more
  
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':launcher:mergeDexRelease'.
  &gt; A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
     &gt; com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
       The number of method references in a .dex file cannot exceed 64K.
       Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
  
  * 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 38s
  Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
  0x00007ff67f67736c (Unity) StackWalker::GetCurrentCallstack
  0x00007ff67f67d509 (Unity) StackWalker::ShowCallstack
  0x00007ff67fe6f193 (Unity) GetStacktrace
  0x00007ff680d705ba (Unity) DebugStringToFile
  0x00007ff67f80750d (Unity) DebugLogHandler_CUSTOM_Internal_Log
  0x000001e5a38a2f0b (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
  0x000001e5a38a2e5b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
  0x000001e5a38a28d0 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
  0x000001e5a38a2795 (Mono JIT Code) UnityEngine.Debug:LogError (object)
  0x000001e65b81a623 (Mono JIT Code) UnityEditor.Android.GradleInvokationException:ParseAndShowException ()
  0x000001e7272b2cf3 (Mono JIT Code) UnityEditor.Android.PostProcessor.PostProcessRunner:RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext)
  0x000001e6a04ee4ab (Mono JIT Code) UnityEditor.Android.PostProcessAndroidPlayer:PostProcess (UnityEditor.BuildTarget,string,string,string,string,string,string,UnityEditor.BuildOptions,UnityEditor.RuntimeClassRegistry,UnityEditor.Build.Reporting.BuildReport)
  0x000001e6a050f94b (Mono JIT Code) UnityEditor.Android.AndroidBuildPostprocessor:PostProcess (UnityEditor.Modules.BuildPostProcessArgs,UnityEditor.BuildProperties&amp;)
  0x000001e6a050f291 (Mono JIT Code) UnityEditor.PostprocessBuildPlayer:Postprocess (UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,string,string,string,int,int,UnityEditor.BuildOptions,UnityEditor.RuntimeClassRegistry,UnityEditor.Build.Reporting.BuildReport)
  0x000001e6a050f589 (Mono JIT Code) (wrapper runtime-invoke) &lt;Module&gt;:runtime_invoke_void_int_int_object_object_object_int_int_int_object_object (object,intptr,intptr,intptr)
  0x00007fff733fe640 (mono-2.0-bdwgc) [mini-runtime.c:2812] mono_jit_runtime_invoke 
  0x00007fff73382ad2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
  0x00007fff7338bb2f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
  0x00007ff67f5c2be4 (Unity) scripting_method_invoke
  0x00007ff67f5be251 (Unity) ScriptingInvocation::Invoke
  0x00007ff680e83321 (Unity) CallMono
  0x00007ff680e8991d (Unity) PostprocessPlayer
  0x00007ff680e857d3 (Unity) DoBuildPlayer_PostBuild
  0x00007ff680e84370 (Unity) DoBuildPlayer
  0x00007ff680e79e45 (Unity) BuildPlayer
  0x00007ff680458a05 (Unity) BuildPipeline::BuildPlayerInternalNoCheck
  0x00007ff68042b5ac (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
  0x000001e72728408a (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,UnityEditor.BuildOptions,string[],bool)
  0x000001e72728386b (Mono JIT Code) UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
  0x000001e7272806db (Mono JIT Code) UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
  0x000001e72718bf93 (Mono JIT Code) UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform)
  0x000001e727174003 (Mono JIT Code) UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
  0x000001e727165acb (Mono JIT Code) UnityEditor.BuildPlayerWindow:OnGUI ()
  0x000001e6bf072b73 (Mono JIT Code) UnityEditor.HostView:InvokeOnGUI (UnityEngine.Rect,UnityEngine.Rect)
  0x000001e6bf0728e3 (Mono JIT Code) UnityEditor.DockArea:DrawView (UnityEngine.Rect,UnityEngine.Rect)
  0x000001e6bf0679d3 (Mono JIT Code) UnityEditor.DockArea:OldOnGUI ()
  0x000001e554868108 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:DoOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool,UnityEngine.Rect,System.Action,bool)
  0x000001e5548e56db (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,System.Action,bool)
  0x000001e7271576bb (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,System.Action,bool)
  0x000001e727157543 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,bool)
  0x000001e727156d9b (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase,bool,bool)
  0x000001e727154183 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI (UnityEngine.UIElements.EventBase,bool,bool)
  0x000001e6b7a9b12b (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleEvent (UnityEngine.UIElements.EventBase)
  0x000001e6b7a89ab8 (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase)
  0x000001e727151983 (Mono JIT Code) UnityEngine.UIElements.MouseCaptureDispatchingStrategy:DispatchEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
  0x000001e6b7a87d8e (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,bool)
  0x000001e6b7a87883 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
  0x000001e6b7a8d833 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEventQueue ()
  0x000001e6b7a8bee3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:OpenGate ()
  0x000001e6b7a8be2b (Mono JIT Code) UnityEngine.UIElements.EventDispatcherGate:Dispose ()
  0x000001e6b7a87b13 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
  0x000001e6b7a871e3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:Dispatch (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,UnityEngine.UIElements.DispatchMode)
  0x000001e6b7a8705b (Mono JIT Code) UnityEngine.UIElements.BaseVisualElementPanel:SendEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.DispatchMode)
  0x000001e6b8b2205b (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
  0x000001e6b8b21afb (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&amp;)
  0x000001e6b8b218bf (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration:ProcessEvent (int,intptr)
  0x000001e6b8b217db (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration/&lt;&gt;c:&lt;.cctor&gt;b__1_2 (int,intptr)
  0x000001e6b8b2165d (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&amp;)
  0x000001e6b8b2170e (Mono JIT Code) (wrapper runtime-invoke) &lt;Module&gt;:runtime_invoke_void_int_intptr_intptr&amp; (object,intptr,intptr,intptr)
  0x00007fff733fe640 (mono-2.0-bdwgc) [mini-runtime.c:2812] mono_jit_runtime_invoke 
  0x00007fff73382ad2 (mono-2.0-bdwgc) [object.c:2921] do_runtime_invoke 
  0x00007fff7338bb2f (mono-2.0-bdwgc) [object.c:2968] mono_runtime_invoke 
  0x00007ff67f5c2be4 (Unity) scripting_method_invoke
  0x00007ff67f5be251 (Unity) ScriptingInvocation::Invoke
  0x00007ff67f5b8615 (Unity) ScriptingInvocation::Invoke&lt;void&gt;
  0x00007ff67e89b23a (Unity) Scripting::UnityEngine::GUIUtilityProxy::ProcessEvent
  0x00007ff67f9ae0f6 (Unity) GUIView::ProcessRetainedMode
  0x00007ff67fe9a8a2 (Unity) GUIView::OnInputEvent
  0x00007ff67f9adfe2 (Unity) GUIView::ProcessInputEvent
  0x00007ff67fe9b8c9 (Unity) GUIView::ProcessEventMessages
  0x00007ff67fe95a08 (Unity) GUIView::GUIViewWndProc
  0x00007ffff24ae858 (USER32) CallWindowProcW
  0x00007ffff24ae299 (USER32) DispatchMessageW
  0x00007ff67fe74d76 (Unity) MainMessageLoop
  0x00007ff67fe78af6 (Unity) WinMain
  0x00007ff6819a5682 (Unity) __scrt_common_main_seh
  0x00007ffff1fd7034 (KERNEL32) BaseThreadInitThunk
  0x00007ffff2c22651 (ntdll) RtlUserThreadStart
  
  CommandInvokationFailure: Gradle build failed. 
  C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath &quot;C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-5.6.4.jar&quot; org.gradle.launcher.GradleMain &quot;-Dorg.gradle.jvmargs=-Xmx4096m&quot; &quot;bundleRelease&quot;
  
  stderr[
  Note: C:\Users\cheth\FlutteringBirds1\Temp\gradleOut\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
  Note: Recompile with -Xlint:deprecation for details.
  D8: Cannot fit requested classes in a single dex file (# methods: 70023 &gt; 65536)
  com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
  The number of method references in a .dex file cannot exceed 64K.
  Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
      at com.android.builder.dexing.D8DexArchiveMerger.getExceptionToRethrow(D8DexArchiveMerger.java:132)
      at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:119)
      at com.android.build.gradle.internal.transforms.DexMergerTransformCallable.call(DexMergerTransformCallable.java:102)
      at com.android.build.gradle.internal.tasks.DexMergingTaskRunnable.run(DexMergingTask.kt:445)
      at com.android.build.gradle.internal.tasks.Workers$ActionFacade.run(Workers.kt:348)
      at org.gradle.workers.internal.AdapterWorkAction.execute(AdapterWorkAction.java:50)
      at org.gradle.workers.internal.DefaultWorkerServer.execute(DefaultWorkerServer.java:47)
      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:65)
      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1$1.create(NoIsolationWorkerFactory.java:61)
      at org.gradle.internal.classloader.ClassLoaderUtils.executeInClassloader(ClassLoaderUtils.java:98)
      at org.gradle.workers.internal.NoIsolationWorkerFactory$1$1.execute(NoIsolationWorkerFactory.java:61)
      at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:44)
      at org.gradle.workers.internal.AbstractWorker$1.call(AbstractWorker.java:41)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:416)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$CallableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:406)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor$1.execute(DefaultBuildOperationExecutor.java:165)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:250)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:158)
      at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:102)
      at org.gradle.internal.operations.DelegatingBuildOperationExecutor.call(DelegatingBuildOperationExecutor.java:36)
      at org.gradle.workers.internal.AbstractWorker.executeWrappedInBuildOperation(AbstractWorker.java:41)
      at org.gradle.workers.internal.NoIsolationWorkerFactory$1.execute(NoIsolationWorkerFactory.java:56)
      at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:215)
      at org.gradle.workers.internal.DefaultWorkerExecutor$3.call(DefaultWorkerExecutor.java:210)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runExecution(DefaultConditionalExecutionQueue.java:215)
      at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.runBatch(DefaultConditionalExecutionQueue.java:164)
      at org.gradle.internal.work.DefaultConditionalExecutionQueue$ExecutionRunner.run(DefaultConditionalExecutionQueue.java:131)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run(FutureTask.java:266)
      at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
      at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
      at java.lang.Thread.run(Thread.java:748)
  Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
      at com.android.tools.r8.utils.O.a(:65)
      at com.android.tools.r8.D8.run(:11)
      at com.android.builder.dexing.D8DexArchiveMerger.mergeDexArchives(D8DexArchiveMerger.java:117)
      ... 34 more
  Caused by: com.android.tools.r8.utils.b: Error: null, Cannot fit requested classes in a single dex file (# methods: 70023 &gt; 65536)
      at com.android.tools.r8.utils.y0.a(:21)
      at com.android.tools.r8.dex.K.a(:56)
      at com.android.tools.r8.dex.K$h.a(:5)
      at com.android.tools.r8.dex.b.b(:15)
      at com.android.tools.r8.dex.b.a(:38)
      at com.android.tools.r8.D8.d(:87)
      at com.android.tools.r8.D8.b(:1)
      at com.android.tools.r8.utils.O.a(:30)
      ... 36 more
  
  
  FAILURE: Build failed with an exception.
  
  * What went wrong:
  Execution failed for task ':launcher:mergeDexRelease'.
  &gt; A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
     &gt; com.android.builder.dexing.DexArchiveMergerException: Error while merging dex archives: 
       The number of method references in a .dex file cannot exceed 64K.
       Learn how to resolve this issue at https://developer.android.com/tools/building/multidex.html
  
  * 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 38s
  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
  
  &gt; 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.
  Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
  Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
  Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
  Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
  Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\28.0.3\package.xml. Probably the SDK is read-only
  Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
  Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-29\package.xml. Probably the SDK is read-only
  Exception while marshalling C:\Program Files\Unity\Hub\Editor\2021.1.7f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
  
  &gt; Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preBuild UP-TO-DATE
  &gt; Task :launcher:preBuild UP-TO-DATE
  </code></pre>