Unity 2D 构建到 android 时出现错误

问题描述 投票:0回答:1

我正在尝试为 Android 构建我的游戏。我正在使用最新的 untiy 版本 2022.3.5f1,并直接构建到我的手机(构建和运行)。

每次都会弹出这3个错误。

1:

Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-31\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-32\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-31\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-32\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :launcher:preDebugBuild UP-TO-DATE
> Task :unityLibrary:preDebugBuild UP-TO-DATE
> Task :launcher:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :unityLibrary:compileDebugAidl NO-SOURCE
> Task :launcher:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:packageDebugRenderscript NO-SOURCE
> Task :launcher:compileDebugAidl NO-SOURCE
> Task :unityLibrary:writeDebugAarMetadata UP-TO-DATE
> Task :launcher:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:compileDebugRenderscript NO-SOURCE
> Task :launcher:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:generateDebugResValues UP-TO-DATE
> Task :unityLibrary:generateDebugResources UP-TO-DATE
> Task :unityLibrary:packageDebugResources UP-TO-DATE
> Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
> Task :launcher:generateDebugResValues UP-TO-DATE
> Task :launcher:generateDebugResources UP-TO-DATE
> Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
> Task :launcher:mergeDebugResources UP-TO-DATE
> Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :launcher:extractDeepLinksDebug UP-TO-DATE
> Task :launcher:mergeDebugShaders UP-TO-DATE
> Task :launcher:compileDebugShaders NO-SOURCE
> Task :launcher:generateDebugAssets UP-TO-DATE
> Task :launcher:processDebugJavaRes NO-SOURCE
> Task :launcher:checkDebugDuplicateClasses UP-TO-DATE
> Task :launcher:checkDebugAarMetadata
> Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:compileDebugShaders NO-SOURCE
> Task :unityLibrary:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:processDebugManifest
> Task :unityLibrary:parseDebugLocalResources
> Task :unityLibrary:packageDebugAssets
> Task :unityLibrary:processDebugJavaRes UP-TO-DATE
> Task :unityLibrary:bundleLibResDebug UP-TO-DATE
> Task :unityLibrary:mergeDebugJniLibFolders UP-TO-DATE
> Task :launcher:processDebugMainManifest
> Task :unityLibrary:mergeDebugNativeLibs
> Task :launcher:processDebugManifest
> Task :unityLibrary:generateDebugRFile
> Task :launcher:mergeDebugAssets
> Task :launcher:compressDebugAssets
> Task :unityLibrary:copyDebugJniLibsProjectOnly
> Task :launcher:mergeDebugJavaResource

> Task :unityLibrary:compileDebugJavaWithJavac FAILED

> Task :launcher:processDebugManifestForPackage
> Task :launcher:desugarDebugFileDependencies
34 actionable tasks: 15 executed, 19 up-to-date

0x00007ff677c78e4d (Unity) StackWalker::GetCurrentCallstack
0x00007ff677c7ddf9 (Unity) StackWalker::ShowCallstack
0x00007ff678c4b121 (Unity) GetStacktrace
0x00007ff67930d922 (Unity) DebugStringToFile
0x00007ff676bc97f6 (Unity) DebugLogHandler_CUSTOM_Internal_Log
0x0000022ebe2d1c93 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
0x0000022ebe2d1bcb (Mono JIT Code) UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object[])
0x0000022ebe2d1950 (Mono JIT Code) UnityEngine.Logger:Log (UnityEngine.LogType,object)
0x0000022fc8811bb5 (Mono JIT Code) UnityEngine.Debug:LogError (object)
0x0000022fc88116b3 (Mono JIT Code) UnityEditor.Android.GradleInvokationException:ParseAndShowException ()
0x0000022f92327423 (Mono JIT Code) UnityEditor.Android.PostProcessor.PostProcessRunner:RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext)
0x0000022fc87d8fb3 (Mono JIT Code) UnityEditor.Android.PostProcessAndroidPlayer:PostProcess (UnityEditor.Modules.BuildPostProcessArgs,AndroidPlayerBuildProgram.Data.AndroidPlayerBuildProgramOutput)
0x0000022fc8790db3 (Mono JIT Code) UnityEditor.Android.AndroidBuildPostprocessor:PostProcess (UnityEditor.Modules.BuildPostProcessArgs,UnityEditor.BuildProperties&)
0x0000022fc8790481 (Mono JIT Code) UnityEditor.PostprocessBuildPlayer:Postprocess (UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,string,string,string,int,int,UnityEditor.BuildOptions,UnityEditor.RuntimeClassRegistry,UnityEditor.Build.Reporting.BuildReport)
0x0000022fc87907f5 (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)
0x00007ffe788de0d4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffe7881eb74 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ffe7881ed0c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
0x00007ff677b97bc4 (Unity) scripting_method_invoke
0x00007ff677b76844 (Unity) ScriptingInvocation::Invoke
0x00007ff6796823b1 (Unity) CallMono
0x00007ff67968b267 (Unity) PostprocessPlayer
0x00007ff679685653 (Unity) DoBuildPlayer_PostBuild
0x00007ff67968374e (Unity) DoBuildPlayer
0x00007ff679677085 (Unity) BuildPlayer
0x00007ff67741432f (Unity) BuildPipeline::BuildPlayerInternalNoCheck
0x00007ff6771a4ffc (Unity) BuildPipeline_CUSTOM_BuildPlayerInternalNoCheck
0x0000022f16d14927 (Mono JIT Code) (wrapper managed-to-native) UnityEditor.BuildPipeline:BuildPlayerInternalNoCheck (string[],string,string,UnityEditor.BuildTargetGroup,UnityEditor.BuildTarget,int,UnityEditor.BuildOptions,string[],bool)
0x0000022f16d140f3 (Mono JIT Code) UnityEditor.BuildPlayerWindow/DefaultBuildMethods:BuildPlayer (UnityEditor.BuildPlayerOptions)
0x0000022f16d104bb (Mono JIT Code) UnityEditor.BuildPlayerWindow:CallBuildMethods (bool,UnityEditor.BuildOptions)
0x0000022ec951fc43 (Mono JIT Code) UnityEditor.BuildPlayerWindow:BuildPlayerAndRun (bool)
0x0000022eea9971d3 (Mono JIT Code) UnityEditor.BuildPlayerWindow:GUIBuildButtons (UnityEditor.Modules.IBuildWindowExtension,bool,bool,bool,UnityEditor.Build.BuildPlatform,UnityEditor.Modules.IBuildPostprocessor)
0x0000022ec95177fb (Mono JIT Code) UnityEditor.BuildPlayerWindow:ShowBuildTargetSettings ()
0x0000022ec8408f9b (Mono JIT Code) UnityEditor.BuildPlayerWindow:OnGUI ()
0x0000022ebd2d2892 (Mono JIT Code) UnityEditor.HostView:InvokeOnGUI (UnityEngine.Rect)
0x0000022fbc33cbf3 (Mono JIT Code) UnityEditor.DockArea:DrawView (UnityEngine.Rect)
0x0000022fbc333883 (Mono JIT Code) UnityEditor.DockArea:OldOnGUI ()
0x0000022ebb920a1f (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:DoOnGUI (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,bool,UnityEngine.Rect,System.Action,bool)
0x0000022ebb91e65b (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,UnityEngine.Matrix4x4,UnityEngine.Rect,System.Action,bool)
0x0000022ebb91db7b (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,System.Action,bool)
0x0000022ebb91da03 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:HandleIMGUIEvent (UnityEngine.Event,bool)
0x0000022ebb91d60b (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUIRaw (UnityEngine.UIElements.EventBase,bool,bool)
0x0000022ebb91d503 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:SendEventToIMGUI (UnityEngine.UIElements.EventBase,bool,bool)
0x0000022eb363a673 (Mono JIT Code) UnityEngine.UIElements.IMGUIContainer:ProcessEvent (UnityEngine.UIElements.EventBase)
0x0000022eb363a253 (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEvent (UnityEngine.UIElements.EventBase)
0x0000022eb3639f8f (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEventAtCurrentTargetAndPhase (UnityEngine.UIElements.EventBase)
0x0000022eb3639d13 (Mono JIT Code) UnityEngine.UIElements.CallbackEventHandler:HandleEventAtTargetPhase (UnityEngine.UIElements.EventBase)
0x0000022ebb91c21b (Mono JIT Code) UnityEngine.UIElements.MouseCaptureDispatchingStrategy:DispatchEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x0000022eb4a200ae (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ApplyDispatchingStrategies (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,bool)
0x0000022eb477fa1b (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x0000022eb22854d3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEventQueue ()
0x0000022eb2285343 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:OpenGate ()
0x0000022eb228529b (Mono JIT Code) UnityEngine.UIElements.EventDispatcherGate:Dispose ()
0x0000022eb477fef3 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:ProcessEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel)
0x0000022eb477c073 (Mono JIT Code) UnityEngine.UIElements.EventDispatcher:Dispatch (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.IPanel,UnityEngine.UIElements.DispatchMode)
0x0000022eb477beeb (Mono JIT Code) UnityEngine.UIElements.BaseVisualElementPanel:SendEvent (UnityEngine.UIElements.EventBase,UnityEngine.UIElements.DispatchMode)
0x0000022ebb902213 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:DoDispatch (UnityEngine.UIElements.BaseVisualElementPanel)
0x0000022ebb901b43 (Mono JIT Code) UnityEngine.UIElements.UIElementsUtility:UnityEngine.UIElements.IUIElementsUtility.ProcessEvent (int,intptr,bool&)
0x0000022ebb90193f (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration:ProcessEvent (int,intptr)
0x0000022ebb90187b (Mono JIT Code) UnityEngine.UIElements.UIEventRegistration/<>c:<.cctor>b__1_2 (int,intptr)
0x0000022ebb9016cd (Mono JIT Code) UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)
0x0000022ebb901786 (Mono JIT Code) (wrapper runtime-invoke) <Module>:runtime_invoke_void_int_intptr_intptr& (object,intptr,intptr,intptr)
0x00007ffe788de0d4 (mono-2.0-bdwgc) mono_jit_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/mini/mini-runtime.c:3445)
0x00007ffe7881eb74 (mono-2.0-bdwgc) do_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3066)
0x00007ffe7881ed0c (mono-2.0-bdwgc) mono_runtime_invoke (at C:/build/output/Unity-Technologies/mono/mono/metadata/object.c:3113)
0x00007ff677b97bc4 (Unity) scripting_method_invoke
0x00007ff677b76844 (Unity) ScriptingInvocation::Invoke
0x00007ff677b71495 (Unity) ScriptingInvocation::Invoke<void>
0x00007ff677cc356a (Unity) Scripting::UnityEngine::GUIUtilityProxy::ProcessEvent
0x00007ff6786b6518 (Unity) GUIView::ProcessRetainedMode
0x00007ff678c7d414 (Unity) GUIView::OnInputEvent
0x00007ff6786b6463 (Unity) GUIView::ProcessInputEventFromAPI
0x00007ff6786b6338 (Unity) GUIView::ProcessInputEvent
0x00007ff678c7e21c (Unity) GUIView::ProcessEventMessages
0x00007ff678c77fa5 (Unity) GUIView::GUIViewWndProc
0x00007ffef6ac8211 (USER32) DispatchMessageW
0x00007ffef6ac7cd1 (USER32) DispatchMessageW
0x00007ff678c51693 (Unity) MainMessageLoop
0x00007ff678c56910 (Unity) WinMain
0x00007ff67a04133e (Unity) __scrt_common_main_seh
0x00007ffef75326ad (KERNEL32) BaseThreadInitThunk
0x00007ffef89eaa68 (ntdll) RtlUserThreadStart

2:

3:

CommandInvokationFailure: Gradle build failed. 
C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleDebug"

Environment Variables:
__PSLockDownPolicy = 0
USERDOMAIN = TOMICA-BRPO
ProgramFiles = C:\Program Files
LAUNCH_DARKLY_CLIENT_TOKEN = 60a7e30fafc7e60e33446283
TMP = C:\Users\bruno\AppData\Local\Temp
PROCESSOR_ARCHITECTURE = AMD64
PROCESSOR_REVISION = 6001
OS = Windows_NT
CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_4044_TPIZLSLYSGMNWFZH
PROCESSOR_IDENTIFIER = AMD64 Family 23 Model 96 Stepping 1, AuthenticAMD
ProgramW6432 = C:\Program Files
USERPROFILE = C:\Users\bruno
JAVA_HOME = C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK
CommonProgramFiles = C:\Program Files\Common Files
DriverData = C:\Windows\System32\Drivers\DriverData
ComSpec = C:\WINDOWS\system32\cmd.exe
AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa
PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules
ANDROID_NDK_ROOT = C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK
SystemRoot = C:\WINDOWS
HEAP_CLIENT_TOKEN = 1717415662
NUMBER_OF_PROCESSORS = 6
AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21
WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3
JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-8
DEBUG_ENV_VAR = UnityHub
BURST_ANDROID_MIN_API_LEVEL = 22
EFC_6804 = 1
TEMP = C:\Users\bruno\AppData\Local\Temp
Path = C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\Java\jdk-18.0.2.1\bin;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files\Eclipse Adoptium\jdk-17.0.1.12-hotspot\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\dotnet\;C:\msys64\mingw64\bin;C:\Program Files\Git\cmd;;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\Git LFS;C:\Users\bruno\AppData\Local\Programs\Python\Python311\Scripts\;C:\Users\bruno\AppData\Local\Programs\Python\Python311\;C:\Users\bruno\scoop\shims;C:\Users\bruno\AppData\Local\Programs\Python\Python310\Scripts\;C:\Users\bruno\AppData\Local\Programs\Python\Python310\;C:\Users\bruno\AppData\Local\Microsoft\WindowsApps;C:\Users\bruno\AppData\Local\GitHubDesktop\bin;C:\Users\bruno\AppData\Roaming\npm;C:\Users\bruno\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\bruno\.dotnet\tools;;C:\Users\bruno\AppData\Local\Programs\oh-my-posh\bin;C:\Users\bruno\AppData\Local\Programs\oh-my-posh\themes;C:\Program Files (x86)\GitHub CLI\;C:\Users\bruno\AppData\Local\Microsoft\WindowsApps;C:\Program Files\Neovim\bin;C:\Users\bruno\AppData\Local\Microsoft\WinGet\Packages\BurntSushi.ripgrep.MSVC_Microsoft.Winget.Source_8wekyb3d8bbwe\./ripgrep-13.0.0-x86_64-pc-windows-msvc;
USERNAME = bruno
COMPUTERNAME = TOMICA-BRPO
PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
SystemDrive = C:
ALLUSERSPROFILE = C:\ProgramData
SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017
HEAP_CLIENT_TOKEN_STAGING = 3786794399
windir = C:\WINDOWS
HOMEPATH = \Users\bruno
PUBLIC = C:\Users\Public
CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files
APPDATA = C:\Users\bruno\AppData\Roaming
OneDrive = C:\Users\bruno\OneDrive
PROCESSOR_LEVEL = 23
CommonProgramW6432 = C:\Program Files\Common Files
ProgramFiles(x86) = C:\Program Files (x86)
SESSIONNAME = Console
GIT_LFS_PATH = C:\Program Files\Git LFS
LOGONSERVER = \\TOMICA-BRPO
LOCALAPPDATA = C:\Users\bruno\AppData\Local
VBOX_HWVIRTEX_IGNORE_SVM_IN_USE = 1
VBOX_MSI_INSTALL_PATH = C:\Program Files\Oracle\VirtualBox\
LAUNCH_DARKLY_CLIENT_TOKEN_STAGING = 60a7e30fafc7e60e33446282
HOMEDRIVE = C:
USERDOMAIN_ROAMINGPROFILE = TOMICA-BRPO
ProgramData = C:\ProgramData
ORIGINAL_XDG_CURRENT_DESKTOP = undefined


stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
C:\Users\bruno\GOLDEN_GOOSE\GOLDEN GOOSE\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
C:\Users\bruno\GOLDEN_GOOSE\GOLDEN GOOSE\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: C:\Users\bruno\GOLDEN_GOOSE\GOLDEN GOOSE\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:compileDebugJavaWithJavac'.
> 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 9s
]
stdout[
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-31\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-32\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-31\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-32\package.xml. Probably the SDK is read-only
Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.5f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only
> Task :launcher:preBuild UP-TO-DATE
> Task :unityLibrary:preBuild UP-TO-DATE
> Task :launcher:preDebugBuild UP-TO-DATE
> Task :unityLibrary:preDebugBuild UP-TO-DATE
> Task :launcher:mergeDebugNativeDebugMetadata NO-SOURCE
> Task :unityLibrary:compileDebugAidl NO-SOURCE
> Task :launcher:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:packageDebugRenderscript NO-SOURCE
> Task :launcher:compileDebugAidl NO-SOURCE
> Task :unityLibrary:writeDebugAarMetadata UP-TO-DATE
> Task :launcher:compileDebugRenderscript NO-SOURCE
> Task :unityLibrary:compileDebugRenderscript NO-SOURCE
> Task :launcher:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:generateDebugResValues UP-TO-DATE
> Task :unityLibrary:generateDebugResources UP-TO-DATE
> Task :unityLibrary:packageDebugResources UP-TO-DATE
> Task :unityLibrary:extractDeepLinksDebug UP-TO-DATE
> Task :launcher:generateDebugResValues UP-TO-DATE
> Task :launcher:generateDebugResources UP-TO-DATE
> Task :unityLibrary:compileDebugLibraryResources UP-TO-DATE
> Task :launcher:mergeDebugResources UP-TO-DATE
> Task :launcher:createDebugCompatibleScreenManifests UP-TO-DATE
> Task :launcher:extractDeepLinksDebug UP-TO-DATE
> Task :launcher:mergeDebugShaders UP-TO-DATE
> Task :launcher:compileDebugShaders NO-SOURCE
> Task :launcher:generateDebugAssets UP-TO-DATE
> Task :launcher:processDebugJavaRes NO-SOURCE
> Task :launcher:checkDebugDuplicateClasses UP-TO-DATE
> Task :launcher:checkDebugAarMetadata
> Task :unityLibrary:generateDebugBuildConfig UP-TO-DATE
> Task :unityLibrary:javaPreCompileDebug UP-TO-DATE
> Task :unityLibrary:mergeDebugShaders UP-TO-DATE
> Task :unityLibrary:compileDebugShaders NO-SOURCE
> Task :unityLibrary:generateDebugAssets UP-TO-DATE
> Task :unityLibrary:processDebugManifest
> Task :unityLibrary:parseDebugLocalResources
> Task :unityLibrary:packageDebugAssets
> Task :unityLibrary:processDebugJavaRes UP-TO-DATE
> Task :unityLibrary:bundleLibResDebug UP-TO-DATE
> Task :unityLibrary:mergeDebugJniLibFolders UP-TO-DATE
> Task :launcher:processDebugMainManifest
> Task :unityLibrary:mergeDebugNativeLibs
> Task :launcher:processDebugManifest
> Task :unityLibrary:generateDebugRFile
> Task :launcher:mergeDebugAssets
> Task :launcher:compressDebugAssets
> Task :unityLibrary:copyDebugJniLibsProjectOnly
> Task :launcher:mergeDebugJavaResource

> Task :unityLibrary:compileDebugJavaWithJavac FAILED

> Task :launcher:processDebugManifestForPackage
> Task :launcher:desugarDebugFileDependencies
34 actionable tasks: 15 executed, 19 up-to-date
]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <8575ccd599f94176ac54c3e24a897458>:0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <8575ccd599f94176ac54c3e24a897458>:0)
UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <8575ccd599f94176ac54c3e24a897458>:0)
UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <8575ccd599f94176ac54c3e24a897458>:0)
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <8575ccd599f94176ac54c3e24a897458>:0)
Rethrow as GradleInvokationException: Gradle build failed
UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <8575ccd599f94176ac54c3e24a897458>:0)
UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <8575ccd599f94176ac54c3e24a897458>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <8575ccd599f94176ac54c3e24a897458>:0)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

我使用unity安装的SDK、JDK、NDK和gradle:

如果还有什么我应该在这里展示的,请现在就告诉我。

如有任何帮助,我们将不胜感激!

android unity-game-engine 2d
1个回答
0
投票

Android Tiramisu 的 API 级别为 33,因此至少需要安装 Android SDK 版本 33。顺便说一句,如果您无法使用 UnityHub 升级 Android SDK,请尝试使用 Android Studio。

© www.soinside.com 2019 - 2024. All rights reserved.