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.
  2. Dismiss Notice

Resolved Failed to update Android SDK package list

Discussion in 'Editor & General Support' started by mraltair, Apr 2, 2021.

  1. mraltair


    Jul 23, 2014
    I am attempting to configure Google Play Game Services into my Android game but ever since I imported the plugin I haven't been able to build an APK. I imagine I have misconfigured it...

    I get the below error:
    Then 4 errors in the console:

    The "Error: Could not find or load main class Files\Unity\Hub\Editor\2020.3.2f1\Editor\Data\PlaybackEngines\AndroidPlayer\SDK\cmdline-tools\latest\bin\\.." seems like it's looking for half a file path? I'm guessing the space in "Program Files" is causing confusion.
    Have I forgotton to comment out a path somewhere?
    Or is a path misconfigured?

    I have tried unticking/ticking the options under Preferences > External Tools. That allowed the build process to start but hung every time on my first scene.

    • I have updated to 2020.3.2f1.
    • Using the JDK/SDK from Unity.
    • I've tried setting the JAVA_HOME environment variable to point to the Unity OpenJDK folder as well as C:\Program Files\Java\jdk-15.0.1
    • I've also tried removing JAVA_HOME
    • I've tried adding a '/' to the end of the paths in External Tools

    I'm not sure what my next step should be, I'd appreciate any help.
  2. mraltair


    Jul 23, 2014
    Resolved by moving the Android SDK into a folder without spaces in it.
    The SDK can't handle "\Program Files\".
    So I changed the location of the Unity editors in Unity Hub to install to C:\UnityEditors.

    I'm sure this was advised to me already.
    allenwp likes this.
  3. Kurt-Dekker


    Mar 16, 2013
    Wow. I remember when Microsoft first pulled that ridiculous "c:\Program Files" grade-A nonsense and here in 2021 it is still biting people

    But is this really true?! Is it true in general of Unity on Windows? Or is it only true if you tell Unity to install the Android SDK and you happen to be under Windows?

    Because if so, you really should file an official bug with Unity. There's no way this is intentional and I bet 90% of Windows users with Unity would be unable to solve this issue on their own.
  4. mraltair


    Jul 23, 2014
    It does seem to be, which is a little mad that I didn't see it come up in my searches across the Internet.

    Android Studio's SDK Manager is what flagged it up to me with the below warning (the file path is just for example):


    I think a similar warning when installing Unity Hub would be useful as the default install folder is
    C:\Program Files\Unity\Hub\Editor ( I will raise it with Unity, maybe they will point out that I blasted past their existing warnings. :D
    Kurt-Dekker likes this.