X
X
xdertax1232021-09-04 16:34:24
Unity
xdertax123, 2021-09-04 16:34:24

Error when building the game in unity 2020.3.17f1, what should I do?

When building the game on Android, the error
Failed to update Android SDK package list appears. See the console for details.
In console 4 errors

first error:
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect/Multimap
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.(SdkManagerCliSettings.java:65)
at com .android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: com .google.common.collect.Multimap
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 3 more
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8

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

second error:
CommandInvokationFailure: Failed to update Android SDK package list.
D:\UnityI\2020.3.17f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat --list

stderr[
Exception in thread "main" java.lang.NoClassDefFoundError: com/google/common/collect /Multimap
at com.android.sdklib.tool.sdkmanager.SdkManagerCliSettings.(SdkManagerCliSettings.java:65)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:57)
at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: com.google.common.collect.Multimap
at java.net.URLClassLoader.findClass(URLClassLoader. java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357 )
... 3 more
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
]
stdout[

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

third error:
Build completed with a result of 'Failed' in 59 seconds (58609 ms)
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

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

I've already reinstalled Unity 5 times , what to do?
(Maybe this will not help, but at the beginning of the installation in all 5 attempts there was a type error - it was not possible to remove the old versions of Android Build)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
Lesh48, 2021-09-05
@Lesh48

Go to edit/preferences and uncheck all SDK related checkboxes, then wait 10 seconds and check all checkboxes again. The Internet is full of answers on the same topic.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question