UnityでのGoogle Admobを使ったAndroidのエラーについて

実現したいこと

UnityでGoogle Admobを使ったゲームのAndroidビルドがしたい。

発生している問題・分からないこと

こちらの2つのエラーが起こります
重要だと思われる部分を抜粋しました。

該当のソースコード

C#

1Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only 2Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only 3Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-31\package.xml. Probably the SDK is read-only 4Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-32\package.xml. Probably the SDK is read-only 5Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only 6~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~767 actionable tasks: 7 executed, 60 up-to-date 8

C#

1CommandInvokationFailure: Gradle build failed. 2C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK\bin\java.exe -classpath "C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-7.2.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx4096m" "assembleRelease"3 4Environment Variables:5PROCESSOR_ARCHITECTURE = AMD64 6AMPLITUDE_API_KEY_YELLOWBUCKET_DEV = 48835b4d1f5e342aefe5f016324d296a 7EFC_9304 = 18BURST_ANDROID_MIN_API_LEVEL = 229DriverData = C:\Windows\System32\Drivers\DriverData 10USERDOMAIN = DESKTOP-30D46L5 11CommonProgramFiles(x86) = C:\Program Files (x86)\Common Files 12COMPUTERNAME = DESKTOP-30D46L5 13DEBUG_ENV_VAR = UnityHub 14LOGONSERVER = \\DESKTOP-30D46L5 15AMPLITUDE_TOKEN_GREENBUCKET_PROD = yyzPzalJDwrQcYNuOZam0bhKb26WyyhK 16PUBLIC = C:\Users\Public 17ProgramData = C:\ProgramData 18SESSIONNAME = Console 19AMPLITUDE_TOKEN_YELLOWBUCKET_PROD = Ph-837Q6GNodAkyc2MRkxVPUcjlIET4d 20ALLUSERSPROFILE = C:\ProgramData 21SystemRoot = C:\Windows 22windir = C:\Windows 23AMPLITUDE_API_KEY_REDBUCKET_DEV = 46b8b46515e7632fc42a504b72e05fd0 24ProgramFiles(x86) = C:\Program Files (x86)25ProgramW6432 = C:\Program Files 26OS = Windows_NT 27ANDROID_NDK_ROOT = C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK 28PROCESSOR_IDENTIFIER = Intel64 Family 6 Model 183 Stepping 1, GenuineIntel 29HEAP_CLIENT_TOKEN_STAGING = 378679439930HOMEPATH = \Users\PC_User 31AMPLITUDE_TOKEN_REDBUCKET_DEV = U4PSN7S7PuYVRODivvdcFwbu8R6IHGqa 32CHROME_CRASHPAD_PIPE_NAME = \\.\pipe\crashpad_22208_NIKJKQUEZVXXWEQQ 33PROCESSOR_LEVEL = 634JAVA_TOOL_OPTIONS = -Dfile.encoding=UTF-835CommonProgramFiles = C:\Program Files\Common Files 36JAVA_HOME = C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\OpenJDK 37USERDOMAIN_ROAMINGPROFILE = DESKTOP-30D46L5 38TEMP = C:\Users\PC_User\AppData\Local\Temp 39ProgramFiles = C:\Program Files 40CommonProgramW6432 = C:\Program Files\Common Files 41AMPLITUDE_TOKEN_YELLOWBUCKET_DEV = wKi8foVigDditGFvmZewRFWsEbX9Y0YO 42AMPLITUDE_API_KEY_GREENBUCKET_DEV = 3ded2a762163603391a425f688f990c8 43AMPLITUDE_API_KEY_REDBUCKET_PROD = ca12bb461ea96f9bdf5df4ded7d52994 44HOMEDRIVE = C:45AMPLITUDE_API_KEY_STAGING = 83ee04fccc67e4fcc7dd527c4c6f1e21 46USERNAME = PC_User 47OneDrive = C:\Users\PC_User\OneDrive 48AMPLITUDE_API_KEY_YELLOWBUCKET_PROD = e03a9bbe92dc38a88cdb068d24c65b46 49PATHEXT = .COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC 50AMPLITUDE_TOKEN_REDBUCKET_PROD = QqyoFpcWPi7V17p80_46CF6-sNGRGbHo 51NUMBER_OF_PROCESSORS = 2852AMPLITUDE_TOKEN_GREENBUCKET_DEV = 84H2gMm_FJzhr3mBaX1lM1JVukmCM7d9 53AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_DEV = client-wbjHYrmeSR87GmWOE7LDpf7sUySOIKHm 54AMPLITUDE_API_KEY_GREENBUCKET_PROD = c86fea37a9e1d3f0878b96e15b111c7c 55ComSpec = C:\Windows\system32\cmd.exe 56ORIGINAL_XDG_CURRENT_DESKTOP = undefined 57PROCESSOR_REVISION = b701 58AMPLITUDE_DEPLOYMENT_KEY_RED_BUCKET_PROD = client-zH8Y7OK1i331EKuG77C6UxN8ygcM6LzS 59TMP = C:\Users\PC_User\AppData\Local\Temp 60SystemDrive = C:61AMPLITUDE_API_KEY = 28f3cae0b33b8b3702120c9ed1a935aa 62OneDriveConsumer = C:\Users\PC_User\OneDrive 63SENTRY_ACCESS_TOKEN = 3df78d9e53f8456aa90fbae044ce1a6261421ab1d0014674bc2e933477289017 64HEAP_CLIENT_TOKEN = 171741566265APPDATA = C:\Users\PC_User\AppData\Roaming 66Path = C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;C:\Users\PC_User\AppData\Local\Microsoft\WindowsApps;C:\Users\PC_User\AppData\Local\Programs\Microsoft VS Code\bin 67PSModulePath = C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules 68LOCALAPPDATA = C:\Users\PC_User\AppData\Local 69USERPROFILE = C:\Users\PC_User 70WOOTRIC_CLIENT_TOKEN = NPS-aa8be4c3 71 72 73stderr[74Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-875 76FAILURE: Build failed with an exception.77 78* What went wrong:79Execution failed for task ':launcher:checkReleaseAarMetadata'.80> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction 81 > One or more issues found when checking AAR metadata values:82 83 Dependency 'androidx.privacysandbox.ads:ads-adservices-java:1.0.0-beta05' requires 'compileSdkVersion' to be set to 33 or higher.84 Compilation target for module ':launcher' is 'android-32'85 86 Dependency 'androidx.privacysandbox.ads:ads-adservices:1.0.0-beta05' requires 'compileSdkVersion' to be set to 33 or higher.87 Compilation target for module ':launcher' is 'android-32'88 89* Try:90Run 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.91 92* Get more help at https://help.gradle.org93 94BUILD FAILED in 1s 95]96stdout[97Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\build-tools\32.0.0\package.xml. Probably the SDK is read-only 98Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platform-tools\package.xml. Probably the SDK is read-only 99Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-31\package.xml. Probably the SDK is read-only 100Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\platforms\android-32\package.xml. Probably the SDK is read-only 101Exception while marshalling C:\Program Files\Unity\Hub\Editor\2022.3.21f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\package.xml. Probably the SDK is read-only 102~~~~~~~~~~~~~~~~~~~~~~~~~~~10367 actionable tasks: 7 executed, 60 up-to-date 104]105exit code: 1106UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c4379596d7a6422890664bcfc2916b9b>:0)107UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c4379596d7a6422890664bcfc2916b9b>:0)108UnityEditor.Android.Command.Run (System.String command, System.String args, System.String workingdir, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c4379596d7a6422890664bcfc2916b9b>:0)109UnityEditor.Android.AndroidJavaTools.RunJava (System.String args, System.String workingdir, System.Action`1[T] progress, System.String error) (at <c4379596d7a6422890664bcfc2916b9b>:0)110UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <c4379596d7a6422890664bcfc2916b9b>:0)111Rethrow as GradleInvokationException: Gradle build failed 112UnityEditor.Android.GradleWrapper.Run (UnityEditor.Android.AndroidJavaTools javaTools, Unity.Android.Gradle.AndroidGradle androidGradle, System.String workingdir, System.String task, System.Action`1[T] progress) (at <c4379596d7a6422890664bcfc2916b9b>:0)113UnityEditor.Android.PostProcessor.Tasks.BuildGradleProject.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c4379596d7a6422890664bcfc2916b9b>:0)114UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <c4379596d7a6422890664bcfc2916b9b>:0)115UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr, Boolean&)

試したこと・調べたこと

上記の詳細・結果

https://docs.unity3d.com/ja/2023.2/Manual/android-gradle-overview.html
→gradleとandroid gradleのバージョンとunityのバージョンがあっていることを確認しました。

補足

Unity2022.3.12f1
Google admobv8.7.0
gradle 7.2
android gradle 7.1.2

コメントを投稿

0 コメント