I am using Unity 2022.3.3f1
I want to build a Android but result in error, the windows version can be built successfully, I observed that the android game can be build when using normal 2D template, but since I want to build a Mobile Game, I chose the 2D mobile template, and it will end up in failure even there is only one single GameObject.
I have tried to look for solution but the error still remains, hopefully there would be solution to end my distress these few days.
The error log as below
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
D:\Unity\Unity Projects\GameName \Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:164: error: cannot find symbol
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU)
^
symbol: variable TIRAMISU
location: class VERSION_CODES
D:\Unity\Unity Projects\GameName\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity\androidnotifications\UnityNotificationManager.java:165: error: cannot find symbol
permissionGranted = mContext.checkCallingOrSelfPermission(Manifest.permission.POST_NOTIFICATIONS) == PackageManager.PERMISSION_GRANTED;
^
symbol: variable POST_NOTIFICATIONS
location: class permission
Note: D:\Unity\Unity Projects\GameName\Library\Bee\Android\Prj\Mono2x\Gradle\unityLibrary\src\main\java\com\unity3d\player\UnityPlayerActivity.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 errors
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ‘:unityLibrary:compileReleaseJavaWithJavac’.
Compilation failed; see the compiler error output for details.
-
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 1s
0x00007ff7b3a02fdd (Unity) StackWalker::GetCurrentCallstack
0x00007ff7b3a07f89 (Unity) StackWalker::ShowCallstack
0x00007ff7b49d2fd1 (Unity) GetStacktrace
0x00007ff7b5094a12 (Unity) DebugStringToFile
0x00007ff7b2929786 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x0000020c49cee443 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x0000020c49cee35b (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[ ])
0x0000020c49cee0a0 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x0000020c54144b55 (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x0000020c54144773 (Mono JIT Code) UnityEditor.Android.GradleInvokationException:ParseAndShowException ()
0x0000020c506a0383 (Mono JIT Code) UnityEditor.Android.PostProcessor.PostProcessRunner:RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext)
0x0000020c5411c4a3 (Mono JIT Code) UnityEditor.Android.PostProcessAndroidPlayer:PostProcess (UnityEditor.Modules.BuildPostProcessArgs,AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput)
0x0000020c540bdd63 (Mono JIT Code) UnityEditor.Android.AndroidBuildPostprocessor:PostProcess (UnityEditor.Modules.BuildPostProcessArgs,UnityEditor.BuildProperties&)
0x0000020c540bd431 (Mono JIT Code) UnityEditor.PostprocessBuildPlayer:Postprocess (UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,string,string,string,int,int,UnityEditor.BuildOptions,UnityEditor.RuntimeClassRegistry,UnityEditor.Build.Reporting.BuildReport)
0x0000020c540bd7a5 (Mono JIT Code) (wrapper runtime-invoke) :runtime_invoke_void_int_int_int_object_object_object_int_int_int_object_object (object,intptr,intptr,intptr)
0x00007ffcefb4e0e4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffcefa8eb84 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ffcefa8ed1c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
0x00007ff7b3921b04 (Unity) scripting_method_invoke
0x00007ff7b3900784 (Unity) ScriptingInvocation::Invoke
0x00007ff7b5408f21 (Unity) CallMono
0x00007ff7b5411dd7 (Unity) PostprocessPlayer
0x00007ff7b540c1c3 (Unity) DoBuildPlayer_PostBuild
0x00007ff7b540a2be (Unity) DoBuildPlayer
0x00007ff7b53fdbf5 (Unity) BuildPlayer
0x00007ff7b319e33f (Unity) BuildPipeline::BuildPlayerInternalNoCheck
0x00007ff7b2ec43bc (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
0x0000020c4ba650f7 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[ ],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,UnityEditor.BuildOptions,string[ ],bool)
0x0000020c4ba64893 (Mono JIT Code) UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
0x0000020c4ba60c3b (Mono JIT Code) UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
0x0000020c4df7dfe3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform,UnityEditor.Modules.IBuildPostprocessor)
0x0000020c4df721cb (Mono JIT Code) UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
0x0000020c4ba5d36b (Mono JIT Code) UnityEditor.BuildPlayerWindow:OnGUI ()
0x0000020c14d9c042 (Mono JIT Code) UnityEditor.HostView:InvokeOnGUI (UnityEngine.Rect)
0x0000020c14d9be23 (Mono JIT Code) UnityEditor.DockArea:smile:rawView (UnityEngine.Rect)
0x0000020c14d56ddb (Mono JIT Code) UnityEditor.DockArea:OldOnGUI ()
0x0000020aadf90a1f (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:smile:oOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool,UnityEngine.Rect,System.Action,bool)
0x0000020c14d445eb (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,System.Action,bool)
0x0000020c4ba47b1b (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,System.Action,bool)
0x0000020c4ba47983 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,bool)
0x0000020c4ba4718b (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase,bool,bool)
0x0000020c4ba43d33 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI (UnityEngine.UIElements.EventBase,bool,bool)
0x0000020c066a3403 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:ProcessEvent (UnityEngine.UIElements.EventBase)
0x0000020c066a2f63 (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEvent (UnityEngine.UIElements.EventBase)
0x0000020c066a2c9f (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase)
0x0000020c066a29d3 (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase)
0x0000020c4ba4064b (Mono JIT Code) UnityEngine.UIElements.MouseCaptureDispatchingStrategy:smile:ispatchEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x0000020c0d9ad6ae (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,bool)
0x0000020c0d9acf7b (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x0000020c0564ce03 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEventQueue ()
0x0000020c0564cc53 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:OpenGate ()
0x0000020c0564cb8b (Mono JIT Code) UnityEngine.UIElements.EventDispatcherGate:smile:ispose ()
0x0000020c0d9ad453 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x0000020c0d9ac853 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:smile:ispatch (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,UnityEngine.UIElements.DispatchMode)
0x0000020c0d9ac6ab (Mono JIT Code) UnityEngine.UIElements.BaseVisualElementPanel:SendEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.DispatchMode)
0x0000020c0d9f5363 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:smile:oDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000020c0d9f4c53 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&)
0x0000020c0d9f4a0f (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration:ProcessEvent (int,intptr)
0x0000020c0d9f492b (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration/<>c:<.cctor>b__1_2 (int,intptr)
0x0000020c0d9f477d (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
0x0000020c0d9f4836 (Mono JIT Code) (wrapper runtime-invoke) :runtime_invoke_void_int_intptr_intptr& (object,intptr,intptr,intptr)
0x00007ffcefb4e0e4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffcefa8eb84 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ffcefa8ed1c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
0x00007ff7b3921b04 (Unity) scripting_method_invoke
0x00007ff7b3900784 (Unity) ScriptingInvocation::Invoke
0x00007ff7b38fb3d5 (Unity) ScriptingInvocation::Invoke
0x00007ff7b3a4d6fa (Unity) Scripting::UnityEngine::GUIUtilityProxy::ProcessEvent
0x00007ff7b443f9d8 (Unity) GUIView::ProcessRetainedMode
0x00007ff7b4a052d4 (Unity) GUIView::OnInputEvent
0x00007ff7b443f923 (Unity) GUIView::ProcessInputEventFromAPI
0x00007ff7b443f7f8 (Unity) GUIView::ProcessInputEvent
0x00007ff7b4a060dc (Unity) GUIView::ProcessEventMessages
0x00007ff7b49ffdfa (Unity) GUIView::GUIViewWndProc
0x00007ffd2489e858 (USER32) CallWindowProcW
0x00007ffd2489e299 (USER32) DispatchMessageW
0x00007ff7b49d9533 (Unity) MainMessageLoop
0x00007ff7b49de7b0 (Unity) WinMain
0x00007ff7b5dc313e (Unity) __scrt_common_main_seh
0x00007ffd24057614 (KERNEL32) BaseThreadInitThunk
0x00007ffd251026b1 (ntdll) RtlUserThreadStart