Hi. Recently updated Unity from 2021.3.29f1 to 2021.3.36f1 and now I can’t make a build for my Android game. If I make a build with R8 enabled, I get this error:
> Configure project :launcher
WARNING: The option setting 'android.enableR8=true' is deprecated.
It will be removed in version 5.0 of the Android Gradle plugin.
You will no longer be able to disable R8
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preBuild UP-TO-DATE
> Task :unityLibrary:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:packageReleaseRenderscript NO-SOURCE
> Task :launcher:extractProguardFiles UP-TO-DATE
> Task :launcher:preReleaseBuild UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseAidl NO-SOURCE
> Task :launcher:compileReleaseRenderscript NO-SOURCE
> Task :launcher:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:compileReleaseAidl NO-SOURCE
> Task :launcher:javaPreCompileRelease UP-TO-DATE
> Task :launcher:compileReleaseAidl NO-SOURCE
> Task :launcher:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseRenderscript NO-SOURCE
> Task :unityLibrary:generateReleaseResValues UP-TO-DATE
> Task :launcher:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:compileReleaseRenderscript NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseResValues UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseResources UP-TO-DATE
> Task :unityLibrary:generateReleaseResources UP-TO-DATE
> Task :launcher:createReleaseCompatibleScreenManifests UP-TO-DATE
> Task :launcher:extractDeepLinksRelease UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseResources UP-TO-DATE
> Task :unityLibrary:packageReleaseResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:extractDeepLinksRelease UP-TO-DATE
> Task :unityLibrary:extractDeepLinksRelease UP-TO-DATE
> Task :unityLibrary:processReleaseManifest UP-TO-DATE
> Task :unityLibrary:compileReleaseLibraryResources UP-TO-DATE
> Task :unityLibrary:parseReleaseLocalResources UP-TO-DATE
> Task :unityLibrary:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:parseReleaseLocalResources UP-TO-DATE
> Task :unityLibrary:javaPreCompileRelease UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseLibraryResources UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseBuildConfig UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:javaPreCompileRelease UP-TO-DATE
> Task :unityLibrary:prepareLintJarForPublish UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:prepareLintJarForPublish UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processReleaseManifest
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseRFile UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseJavaWithJavac UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibCompileToJarRelease UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseShaders UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:compileReleaseShaders NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:generateReleaseAssets UP-TO-DATE
> Task :unityLibrary:mergeReleaseShaders UP-TO-DATE
> Task :unityLibrary:compileReleaseShaders NO-SOURCE
> Task :unityLibrary:generateReleaseAssets UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:packageReleaseAssets UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseGeneratedProguardFiles UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:exportReleaseConsumerProguardFiles UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:processReleaseJavaRes NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibResRelease NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:bundleLibRuntimeToJarRelease UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseJniLibFolders UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:mergeReleaseNativeLibs UP-TO-DATE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:stripReleaseDebugSymbols NO-SOURCE
> Task :unityLibrary:GoogleMobileAdsPlugin.androidlib:copyReleaseJniLibsProjectOnly UP-TO-DATE
> Task :unityLibrary:packageReleaseAssets
> Task :unityLibrary:processReleaseJavaRes UP-TO-DATE
> Task :unityLibrary:bundleLibResRelease UP-TO-DATE
> Task :unityLibrary:mergeReleaseJniLibFolders UP-TO-DATE
> Task :unityLibrary:mergeReleaseNativeLibs UP-TO-DATE
> Task :unityLibrary:stripReleaseDebugSymbols
> Task :launcher:processReleaseManifest FAILED
> Task :launcher:mergeReleaseResources
> Task :unityLibrary:copyReleaseJniLibsProjectOnly
> Task :unityLibrary:generateReleaseRFile
46 actionable tasks: 7 executed, 39 up-to-date
0x00007ff70eec0d5d (Unity) StackWalker::GetCurrentCallstack
0x00007ff70eec7919 (Unity) StackWalker::ShowCallstack
0x00007ff70fe56303 (Unity) GetStacktrace
0x00007ff71050590d (Unity) DebugStringToFile
0x00007ff70df75762 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x00000261ceba62a3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x00000261ceba61db (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[ ])
0x00000261ceba5f60 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x00000261ceba5e25 (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x0000026219f1bbc3 (Mono JIT Code) UnityEditor.Android.GradleInvokationException:ParseAndShowException ()
0x00000262feb39353 (Mono JIT Code) UnityEditor.Android.PostProcessor.PostProcessRunner:RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext)
0x0000026219f16733 (Mono JIT Code) UnityEditor.Android.PostProcessAndroidPlayer:PostProcess (UnityEditor.Modules.BuildPostProcessArgs,AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput)
0x0000025f850c5063 (Mono JIT Code) UnityEditor.Android.AndroidBuildPostprocessor:PostProcess (UnityEditor.Modules.BuildPostProcessArgs,UnityEditor.BuildProperties&)
0x0000025f850c4778 (Mono JIT Code) UnityEditor.PostprocessBuildPlayer:Postprocess (UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,string,string,string,int,int,UnityEditor.BuildOptions,UnityEditor.RuntimeClassRegistry,UnityEditor.Build.Reporting.BuildReport)
0x0000025f850c4aa5 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_int_int_object_object_object_int_int_int_object_object (object,intptr,intptr,intptr)
0x00007ff9b2a8667e (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
0x00007ff9b29bcdd4 (mono-2.0-bdwgc) [object.c:3068] do_runtime_invoke
0x00007ff9b29bcf4c (mono-2.0-bdwgc) [object.c:3115] mono_runtime_invoke
0x00007ff70ede36d4 (Unity) scripting_method_invoke
0x00007ff70edc2964 (Unity) ScriptingInvocation::Invoke
0x00007ff710878b11 (Unity) CallMono
0x00007ff710881677 (Unity) PostprocessPlayer
0x00007ff71087c210 (Unity) DoBuildPlayer_PostBuild
0x00007ff71087a1be (Unity) DoBuildPlayer
0x00007ff71086d9e5 (Unity) BuildPlayer
0x00007ff70e6b0136 (Unity) BuildPipeline::BuildPlayerInternalNoCheck
0x00007ff70e5b1c50 (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
0x00000261cff5d8a7 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[ ],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,UnityEditor.BuildOptions,string[ ],bool)
0x00000261cff5d153 (Mono JIT Code) UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
0x00000261cff59a73 (Mono JIT Code) UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
0x00000261cff50ef3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform,UnityEditor.Modules.IBuildPostprocessor)
0x00000261cff42d13 (Mono JIT Code) UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
0x00000261cff3a7c3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:OnGUI ()
0x00000261cd37e29a (Mono JIT Code) UnityEditor.HostView:InvokeOnGUI (UnityEngine.Rect)
0x00000261cd37e0f3 (Mono JIT Code) UnityEditor.DockArea:smile:rawView (UnityEngine.Rect)
0x00000261cd36edc3 (Mono JIT Code) UnityEditor.DockArea:OldOnGUI ()
0x00000261cd35ad07 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:smile:oOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool,UnityEngine.Rect,System.Action,bool)
0x00000261cd359ebb (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,System.Action,bool)
0x00000261cd3ccb0b (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,System.Action,bool)
0x00000261cd3cc993 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,bool)
0x00000261ceb2fedb (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase,bool,bool)
0x00000261ceb2fdd3 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI (UnityEngine.UIElements.EventBase,bool,bool)
0x00000261a127ab1b (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleEvent (UnityEngine.UIElements.EventBase)
0x00000261a1264128 (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase)
0x00000261ceb2d983 (Mono JIT Code) UnityEngine.UIElements.MouseCaptureDispatchingStrategy:smile:ispatchEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x00000261a12625ae (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,bool)
0x00000261a126214b (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x00000261a12682bb (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEventQueue ()
0x00000261a12669e3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:OpenGate ()
0x00000261a126693b (Mono JIT Code) UnityEngine.UIElements.EventDispatcherGate:smile:ispose ()
0x00000261a12623d3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x00000261a1261b93 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:smile:ispatch (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,UnityEngine.UIElements.DispatchMode)
0x00000261a1261a2b (Mono JIT Code) UnityEngine.UIElements.BaseVisualElementPanel:SendEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.DispatchMode)
0x00000261cd311223 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:smile:oDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x00000261cd310b53 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&)
0x00000261cd31096f (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration:ProcessEvent (int,intptr)
0x00000261cd3108ab (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration/<>c:<.cctor>b__1_2 (int,intptr)
0x00000261cd3106fd (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
0x00000261cd3107b6 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_intptr_intptr& (object,intptr,intptr,intptr)
0x00007ff9b2a8667e (mono-2.0-bdwgc) [mini-runtime.c:3445] mono_jit_runtime_invoke
0x00007ff9b29bcdd4 (mono-2.0-bdwgc) [object.c:3068] do_runtime_invoke
0x00007ff9b29bcf4c (mono-2.0-bdwgc) [object.c:3115] mono_runtime_invoke
0x00007ff70ede36d4 (Unity) scripting_method_invoke
0x00007ff70edc2964 (Unity) ScriptingInvocation::Invoke
0x00007ff70edbd4c5 (Unity) ScriptingInvocation::Invoke<void>
0x00007ff70ef0935a (Unity) Scripting::UnityEngine::GUIUtilityProxy::ProcessEvent
0x00007ff70f8eab48 (Unity) GUIView::ProcessRetainedMode
0x00007ff70fe856fe (Unity) GUIView::OnInputEvent
0x00007ff70f8eaa93 (Unity) GUIView::ProcessInputEventFromAPI
0x00007ff70f8ea968 (Unity) GUIView::ProcessInputEvent
0x00007ff70fe8655f (Unity) GUIView::ProcessEventMessages
0x00007ff70fe80191 (Unity) GUIView::GUIViewWndProc
0x00007ffa04f289a1 (USER32) DispatchMessageW
0x00007ffa04f28461 (USER32) DispatchMessageW
0x00007ff70fe5b303 (Unity) MainMessageLoop
0x00007ff70fe5f69b (Unity) WinMain
0x00007ff71124287e (Unity) __scrt_common_main_seh
0x00007ffa02ff257d (KERNEL32) BaseThreadInitThunk
0x00007ffa0524aa48 (ntdll) RtlUserThreadStart
But if I make a build with R8 turned off, I get this error:
UnityException: Minification Incompatibility
Only R8 minification is supported when targeting API level 33 and above. Enable "Use R8" option in the Player Settings.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)```
I encountered this 2 years ago when I switched from Unity 2019 to 2021, but then I stopped building absolutely all Android projects, and then the right solution was to completely uninstall Unity from the computer and clean up all traces, then reinstall and customize.
But this time the build problem only affects one project, so there's no point in completely reinstalling Unity. And besides, it takes a lot of time, and I have almost none.
How do you advise to solve this problem? I use only standard Android SDK and other components.