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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Android builds failing with "Unable to locate Android SDK"

Discussion in 'Editor & General Support' started by RiccardoAxed, Dec 16, 2019.

  1. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    Hi, I'm having a big problem with Android builds in v. 2019.2.13, even though in my attempts I experienced it in v. 2019.2.16 too.

    Until yesterday I'd no problems at all but starting from today, when I open whatever Android project (both existing or brand new), I've this warning first:

    Failed getting available Android API levels. Could not find Android SDK Tools.
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)


    Then, when I try to build it, I have a "Unable to locate Android SDK" error

    AndroidSDKerror.png

    When I close the dialog, I've these errors:

    UnityException: Android SDK not found
    Unable to locate Android SDK.
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    Build completed with a result of 'Failed'
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)
    UnityEditor.BuildPlayerWindow+BuildMethodException: 2 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00242] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:95
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)


    By default, in my preferences I've the "SDK/JDK/NDK installed with Unity" options checked, anyway the error doesn't disappear even if I use a path to another SDK folder, both from different Unity version I've installed, both from Android Studio installation.

    In my thousand attempts I managed to build the apk just once, in 2019.2.13 editor, just using the SDK path to the 2019.3.0 folder, but after that the error came back.

    I also tried to reinstall Unity 2019.2.13, to switch to 2019.2.16 and to delete the Library folder in my project (but as already said, the error pops up even on a brand new Android project) without any success.

    I'm rather concened, this is a 100% blocking issue that stops me from working on my customer's requests.
    Have you any idea about what's going on?
     
  2. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    No suggestions at all?

    I'm attaching the editor log here, when I open a project and try to build it, having the usual Android SDK error, maybe it can give some more hints about it.

    It's a full day I'm completely stuck here and unable to make a single build, hope some guy from Unity's staff could help me.
     

    Attached Files:

  3. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
    UPDATE: I just unistalled every Unity editor plus UnityHub and installed them again (UnityHub + Unity 2019.2.13 only) but the Android SDK error popped up again.

    Anyway, the first build after the installation is giving a lot of extra errors, and I'm attaching again the editor log, hoping that can suggest something more about this issue.

    In the following builds the extra errors disappear, leaving me with the same errors I've outlined in the first post and in previous editor log.
     

    Attached Files:

  4. d20kev

    d20kev

    Joined:
    Jul 19, 2019
    Posts:
    16
    are you using Il2CPP?
     
  5. RiccardoAxed

    RiccardoAxed

    Joined:
    Aug 29, 2017
    Posts:
    119
  6. d20kev

    d20kev

    Joined:
    Jul 19, 2019
    Posts:
    16
    glad you were able to get through, still an issue for me.