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

    mraltair

    Joined:
    Jul 23, 2014
    Posts:
    3
    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:
    upload_2021-4-2_11-42-49.png
    Then 4 errors in the console:
    upload_2021-4-2_11-43-10.png
    upload_2021-4-2_11-43-22.png
    upload_2021-4-2_11-43-33.png
    upload_2021-4-2_11-43-50.png

    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

    mraltair

    Joined:
    Jul 23, 2014
    Posts:
    3
    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

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    36,166
    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

    mraltair

    Joined:
    Jul 23, 2014
    Posts:
    3
    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):

    upload_2021-4-3_8-20-16.png

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