B
B
Black Basher2021-01-24 18:01:20
Unity
Black Basher, 2021-01-24 18:01:20

Error when building a Unity project after adding AdMob. How to fix?

I recently added an ad from Google AdMob to my project. Everything worked, the demo ad loaded, but when exporting, it gives an error:
600d8b7f23f91520303438.png
I tried to fix it, reinstalled unity, sdk, changed settings, nothing helps. The project starts building if you remove and re-install all the checkboxes, but it hangs on the first stage, I can’t even cancel it, I have to turn it off through the task manager. Once this method helped, but no longer works. I didn't find a suitable answer anywhere.
Here are the errors from the console:
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion .(SchemaModule.java:156)
at com.android.repository.api.SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81
) (SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base /jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
at java.base/java.lang.ClassLoader .loadClass(ClassLoader.java:522)
... 5 more

UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


CommandInvokationFailure: Failed to update Android SDK package list.
C:\Program Files\Unity\Hub\Editor\2021.1.0b1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat --list

stderr[
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
at com.android.repository.api.SchemaModule$SchemaModuleVersion.(SchemaModule.java:156)
at com.android.repository.api. SchemaModule.(SchemaModule.java:75)
at com.android.sdklib.repository.AndroidSdkHandler.(AndroidSdkHandler.java:81)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
at java.base/jdk.internal.loader. BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java: 522)
... 5 more
]
stdout[

]
exit code: 1
UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <7c7ecdd2a5384d7ab627f71f48950073>: 0)
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <7c7ecdd2a5384d7ab627f71f48950073>:0)
UnityEditor.Android.AndroidSDKTools.RunAndroid (toolName, String.ToExit, System.String arguments, System.Boolean updateCommand, System.String errorMsg, System.String toolsDir, System.String[] warningsToIgnore) (at <7c7ecdd2a5384d7ab627f71f48950073>:0)
UnityEditor.Android.AndroidSDKTools.ListComponentsVersions () (at <7c7ecdd2a5384d7ab687f071> 0)
UnityEditor.Android.SDKManager.UpdatePackagesList() (at <7c7ecdd2a5384d7ab627f71f48950073>:0)
UnityEditor.Android.SDKManager.HighestVersionInstalled (UnityEditor.Android.SDKManager + Component tool) ( at <7c7ecdd2a5384d7ab627f71f48950073>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK SDKToolsDetector.GetVersion + () (AT <7c7ecdd2a5384d7ab627f71f48950073>: 0)
UnityEditor. Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector.Detect (System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress) (at <7c7ecdd2a5384d7ab627f71f48950073>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDKers.EnsureSDKComponent , UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector detector) (at <7c7ecdd2a5384d7ab627f71f48950073>:0)
UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <7c7ecdd2a5384d7ab627f71f48950073>:0)
UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostContext) <7c7ecdd2a5384d7ab627f71f48950073>: 0)
UnityEngine.GUIUtility: ProcessEvent (Int32, IntPtr, & Boolean)


UnityEditor.BuildPlayerWindow + BuildMethodException: 3 errors
at UnityEditor.BuildPlayerWindow + DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002ca] in <0819ea64cba74211b5eefff12d8a617a>: 0
at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in <0819ea64cba74211b5eefff12d8a617a>:0
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)


Please help!

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question