Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

[FIXED] Failed to update Android SDK package list

Discussion in 'Android' started by Pavlos_Mavris, May 6, 2020.

  1. Pavlos_Mavris

    Pavlos_Mavris

    Joined:
    Sep 17, 2018
    Posts:
    55
    I'm trying to build my game and during the build phase I'm getting this error!!

    Screenshot 2020-05-06 at 1.28.43 PM.png


    I'm using Unity 2019.3.12f1
     
  2. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    821
    Do you use a custom SDK? This issue should not happen when using SDK installed from the hub.
     
  3. Pavlos_Mavris

    Pavlos_Mavris

    Joined:
    Sep 17, 2018
    Posts:
    55
    I try to manually download the SDK tools from Android studio and replaced them inside the unity hub files, but it didn't work and I uninstall the unity 2019.3.12f1 and install it again with the default SDK tools but still doesn't works.
     
  4. JuliusM

    JuliusM

    Unity Technologies

    Joined:
    Apr 17, 2013
    Posts:
    821
    What is the error in the console then? Look for a full error message.
     
  5. Pavlos_Mavris

    Pavlos_Mavris

    Joined:
    Sep 17, 2018
    Posts:
    55
    I get this error before trying to build the game!!

    CommandInvokationFailure: Failed to update Android SDK package list.
    /Applications/Unity/Hub/Editor/2019.3.12f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager --list

    stderr[
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(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:583)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 5 more
    ]
    stdout[

    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <3167064085404657b0d6c498207da025>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <3167064085404657b0d6c498207da025>:0)
    UnityEditor.Android.SDKManager.UpdatePackagesList () (at <3167064085404657b0d6c498207da025>:0)
    UnityEditor.Android.SDKManager.ListAvailable (UnityEditor.Android.SDKManager+Component type) (at <3167064085404657b0d6c498207da025>:0)
    UnityEditor.Android.PlayerSettingsEditorExtension+<>c__DisplayClass90_0.<StartGettingReleasedAPILevels>b__0 () (at <3167064085404657b0d6c498207da025>:0)
    System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ThreadHelper.ThreadStart () (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Scripting/UnhandledExceptionHandler.bindings.cs:46)

    During the build phase I get this errors(14 errors):

    1. UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)
    2. at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)
    3. at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    4. at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    5. at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    6. at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    7. Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    8. at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    9. at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    10. at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    11. ... 5 more
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    12. CommandInvokationFailure: Failed to update Android SDK package list.
      /Applications/Unity/Hub/Editor/2019.3.12f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin/sdkmanager --list
      stderr[
      Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
      at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
      at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
      at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(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:583)
      at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
      at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
      ... 5 more
      ]
      stdout[

      ]
      exit code: 1
      UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <3167064085404657b0d6c498207da025>:0)
      UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <3167064085404657b0d6c498207da025>:0)
      UnityEditor.Android.SDKManager.UpdatePackagesList () (at <3167064085404657b0d6c498207da025>:0)
      UnityEditor.Android.SDKManager.HighestVersionInstalled (UnityEditor.Android.SDKManager+Component tool) (at <3167064085404657b0d6c498207da025>:0)
      UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKToolsDetector.GetVersion () (at <3167064085404657b0d6c498207da025>:0)
      UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector.Detect (System.Version minVersion, UnityEditor.Android.PostProcessor.ProgressHandler onProgress) (at <3167064085404657b0d6c498207da025>:0)
      UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.EnsureSDKComponentVersion (System.Version minVersion, UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK+SDKComponentDetector detector) (at <3167064085404657b0d6c498207da025>:0)
      UnityEditor.Android.PostProcessor.Tasks.CheckAndroidSDK.Execute (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <3167064085404657b0d6c498207da025>:0)
      UnityEditor.Android.PostProcessor.PostProcessRunner.RunAllTasks (UnityEditor.Android.PostProcessor.PostProcessorContext context) (at <3167064085404657b0d6c498207da025>:0)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    13. Build completed with a result of 'Failed' in 3 seconds (2711 ms)
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)

    14. UnityEditor.BuildPlayerWindow+BuildMethodException: 13 errors
      at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x002af] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:194
      at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x00080] in /Users/builduser/buildslave/unity/build/Editor/Mono/BuildPlayerWindowBuildMethods.cs:95
      UnityEngine.GUIUtility:processEvent(Int32, IntPtr) (at /Users/builduser/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:187)
    That's all the errors!
    I don't know why there is a smile face there, it should be something like this ": P"
     
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,097
  7. Pavlos_Mavris

    Pavlos_Mavris

    Joined:
    Sep 17, 2018
    Posts:
    55
    Everything seems to be normal inside the preferences, should I changed anything inside Android Studio preferences?
    Also I'll try to upgrade to Unity 2019.3.13f1 and see if this will solve the problem.
    One more thing this error started since I added the Google Play Service plugin.
     
  8. GJBooij

    GJBooij

    Joined:
    Jun 18, 2013
    Posts:
    10
    I'm facing the same issue since I added the Google Play Services plugin (v10.09), using Unity 2019.3.9f1

    Using the JDK/SDK tools/NDK/Gradle from the Unity Hub and preferences are all set and normal.

    Error log:

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

    stderr[
    Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(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:602)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
    ... 5 more
    ]
    stdout[

    ]
    exit code: 1
    UnityEditor.Android.Command.WaitForProgramToRun (UnityEditor.Utils.Program p, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.Command+WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.SDKManager.UpdatePackagesList () (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.SDKManager.ListAvailable (UnityEditor.Android.SDKManager+Component type) (at <c28be54006ad442989ee1a401e08ea78>:0)
    UnityEditor.Android.PlayerSettingsEditorExtension+<>c__DisplayClass89_0.<StartGettingReleasedAPILevels>b__0 () (at <c28be54006ad442989ee1a401e08ea78>:0)
    System.Threading.ThreadHelper.ThreadStart_Context (System.Object state) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ExecutionContext.RunInternal (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state, System.Boolean preserveSyncCtx) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ExecutionContext.Run (System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, System.Object state) (at <437ba245d8404784b9fbab9b439ac908>:0)
    System.Threading.ThreadHelper.ThreadStart () (at <437ba245d8404784b9fbab9b439ac908>:0)
    UnityEngine.<>c:<RegisterUECatcher>b__0_0(Object, UnhandledExceptionEventArgs)
     
    Last edited: May 19, 2020
    intellime likes this.
  9. Pavlos_Mavris

    Pavlos_Mavris

    Joined:
    Sep 17, 2018
    Posts:
    55
    They updated Google Play Services plugin and now I'm not getting any error, probably there was a bug inside the package.
     
  10. GJBooij

    GJBooij

    Joined:
    Jun 18, 2013
    Posts:
    10
  11. Pavlos_Mavris

    Pavlos_Mavris

    Joined:
    Sep 17, 2018
    Posts:
    55
    I was using 10.08 when I got the error, after I updated it to 10.09 everything worked normal
     
    GJBooij likes this.
  12. cbodapati

    cbodapati

    Joined:
    Oct 13, 2008
    Posts:
    13
    Im tried in MAC with Unity 2019.3.2.f1, Unity 2019.3.15.f1 with v10.09. both failed.
    CommandInvokationFailure: Failed to update Android SDK package list.
    The google ads plugin loads, resolver runs, Unity cant build anymore :(

    Any working tutorial will be highly appreciated....
     
  13. Pavlos_Mavris

    Pavlos_Mavris

    Joined:
    Sep 17, 2018
    Posts:
    55
    [SOLUTION]
    Try this go to Unity->Preferences->External Tools and disable(uncheck) the JDK,Android SDK,Android NDK, Grandle.
    Now try to build the game and obviously it will hit error, after that go and enable everything that you have disabled before, now Unity will try to let's say re-install the tools.
     
    Last edited: Jan 24, 2022
  14. DanielJack23

    DanielJack23

    Joined:
    Mar 21, 2015
    Posts:
    2
    Thank you, same issue and this solution has solved it!
     
    max94game and Pavlos_Mavris like this.
  15. Arcstrider

    Arcstrider

    Joined:
    Aug 11, 2020
    Posts:
    2
    Help i have this error i am using the hub sdk jdk and ndk BUT I STILL GET IT HOW pls help





    im stressing out
     
  16. iamvideep

    iamvideep

    Joined:
    Oct 27, 2017
    Posts:
    104
    I just solved this issue and got an android build made.
    Follow the steps:
    1) Check if sdkmanager.bat exists in the unity's modules location. Generally:
    C:\Program Files\Unity\Hub\Editor\2019.4.13f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin
    View attachment 728494

    If NOT, then do a fresh install of unity with android module and DO NOT OPEN UNITY. Copy the file in a safe location first.

    2) Open "cmd" (command prompt) in Administrator mode
    3) Type the unity editors location with --projectPath parameter
    eg (I have masked out my project folder) :
    View attachment 728497

    Once you have provided your project path (the folder which contains "Assets" folder), just go ahead and make an android build.

    Apparently unity runs "sdkmanager.bat --list", but the list runs only in adminn mode.

    Hope you will be able to make android builds.
    I am now after 2-3 months!

    Cheers!
     
  17. dawoodrayan887

    dawoodrayan887

    Joined:
    Sep 17, 2020
    Posts:
    3
    it worked to me to
     
  18. intellime

    intellime

    Joined:
    Mar 18, 2018
    Posts:
    13
    It worked for me. :D
    You saved my life ;)
    Actually after looking at the JDK/NDK/Gradle path in "Unity->Preferences->External Tools" I saw that they were pointing to the 2019.3.xx Unity version that was uninstalled by me!
     
  19. samashi_12

    samashi_12

    Joined:
    Dec 12, 2020
    Posts:
    2
    thank you so much. that helped me. I m using macOs
     
    naromdev likes this.
  20. Seif

    Seif

    Joined:
    Aug 18, 2015
    Posts:
    9
    Sadly still getting this error after trying to integrate google Login, unity 2020.3.0f1
    tried checking/ unchecking , reinstalling the module nothing works
    [EDIT : whenever i try to build my game it gets stuck in building the first scene and never finishes, tried changing the scene and it didn't make a difference i think the build process is broken]
     
    Last edited: Mar 13, 2021
  21. Samhay

    Samhay

    Joined:
    Mar 23, 2011
    Posts:
    5
    This fix still worked with 2019.4.23f1. Needed to make sure that those paths were not pointing to any path that actually contains sdk (were pointing to old version). Working on mac.
     
  22. Fortun

    Fortun

    Joined:
    Dec 16, 2015
    Posts:
    4
    Thanks, it worked for me! ;)
     
  23. BelalGawish

    BelalGawish

    Joined:
    Sep 17, 2019
    Posts:
    5
    Had the same issue, but this solved the problem.
    Thanks
     
  24. sicklepickle

    sicklepickle

    Joined:
    Apr 8, 2012
    Posts:
    43
    Thanks, saved my bacon in 2019.4.11.
    Didn't have to clear the paths or anything.
     
  25. xano_saga

    xano_saga

    Joined:
    Jan 23, 2013
    Posts:
    1
    Thanks man. This helped me in 2019.4.27f1
     
  26. ritesh_khokhani

    ritesh_khokhani

    Joined:
    Jun 26, 2013
    Posts:
    46
    Fixed by disabling JDK and SDK checkboxes in External Tools.

    Using Mac and Unity2021.1.2f1

    Screenshot 2021-07-23 at 4.39.34 PM.png
     
  27. Mumpe

    Mumpe

    Joined:
    Jul 22, 2021
    Posts:
    1
    How strange..it hasn't worked for me. I downloaded and installed android sdk to my windows PC then copied the sdk folder with the bat file to the unity path in preferences, but it still doesn't work
    please help
     
  28. ritesh_khokhani

    ritesh_khokhani

    Joined:
    Jun 26, 2013
    Posts:
    46
    After facing same issue again and again, finally I found the reason and permanent fix for above issue.

    Unity resets JAVA_HOME environment variables as soon as it opens (I don't know why). Few solutions listed above might work temporary. But as you relaunches unity, it again reseted.

    Below editor script fixes problem permanently for me which I am using on mac OS.


    Code (CSharp):
    1. using UnityEditor;
    2. using System;
    3. public class UnityJavaSDKFIx : MonoBehaviour
    4. {
    5.     [InitializeOnLoadMethod]
    6.     static void SetJavaHome()
    7.     {
    8.         Debug.Log("JAVA_HOME in editor was: " + Environment.GetEnvironmentVariable("JAVA_HOME"));
    9.         string newJDKPath = EditorApplication.applicationPath.Replace("Unity.app", "PlaybackEngines/AndroidPlayer/OpenJDK");
    10.         if (Environment.GetEnvironmentVariable("JAVA_HOME") != newJDKPath)
    11.         {
    12.             Environment.SetEnvironmentVariable("JAVA_HOME", newJDKPath);
    13.         }
    14.         Debug.Log("JAVA_HOME in editor set to: " + Environment.GetEnvironmentVariable("JAVA_HOME"));
    15.     }
    16. }
     
    jtiret likes this.
  29. masliy45

    masliy45

    Joined:
    Apr 8, 2021
    Posts:
    1
    Bro you saved me. Thanks
     
  30. unity_QJ7RazXzghZCzA

    unity_QJ7RazXzghZCzA

    Joined:
    Jul 9, 2021
    Posts:
    5
    This helped me to avoid the issue.

    Using Unity 2020.3.17f1.
    Build started to fail after I added some ads sdks into the project.
    Can someone from unity-proprietary team fix this ridiculous bug?
     
    bennetpe and PandaArcade like this.
  31. PandaArcade

    PandaArcade

    Joined:
    Jan 2, 2017
    Posts:
    94
    Thanks, this seemed to have worked for me so far.

    @JuliusM @Tomas1856 Clearly there is an issue here. Please fix :D
     
  32. ericbegue

    ericbegue

    Joined:
    May 31, 2013
    Posts:
    1,336
    That solves the problem for me. But why such obscure operation is necessary?
     
  33. ogtracy

    ogtracy

    Joined:
    Sep 27, 2016
    Posts:
    23
    I solved it a differrent way. I noticed that I had two java installations: The unity recommended version of 1.8 and my usual version of Java 11. My JAVA_HOME environment variable was pointing to JAVA 11, so I updated it to point to unity's copy. After that, I was able to run the install as an administrator from the command line using:

    "C:\Program Files\Unity\Hub\Editor\2021.1.9f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\tools\bin\sdkmanager.bat" "platforms;android-26"
     
    Delodax likes this.
  34. michelesacco

    michelesacco

    Joined:
    Aug 9, 2021
    Posts:
    1
    Thanks, that was the solution for me!
     
  35. rahulbethiGMail

    rahulbethiGMail

    Joined:
    Feb 17, 2022
    Posts:
    1
    Restarting the Unity, solved the problem for me.
     
  36. enzoravo

    enzoravo

    Joined:
    Jun 25, 2013
    Posts:
    282
    thank you, it worked like a charm!
     
  37. andeart

    andeart

    Joined:
    Jan 10, 2014
    Posts:
    2
    I'm on Unity 2021.2.16f1. And surprisingly enough, this workaround from 2020 still works. Much appreciated!
     
  38. samuelmorais

    samuelmorais

    Joined:
    Aug 3, 2012
    Posts:
    54
    This worked for me. An important detail is that just checking and unchecking Gradle starts a whole background process that takes 1 or 2 minutes and I suspect that if I only did this would work, but I didn't test it.
     
    ThisIsKareemG likes this.
unityunity