Android builds failing with "Unable to locate Android SDK"

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:

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

![5288601--530592--AndroidSDKerror.png|632x358](upload://fxE7sJDve6zXiWRGKyD1F9KcBmh.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?

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.

5290935–531000–EditorLog2.txt (46.5 KB)

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.

5290935–530997–EditorLog.txt (1.15 MB)

are you using Il2CPP?

Yes, I’m using IL2CPP but the problem also arises not using it.

Anyway, I posted the issue in the Android section of the forum, and somehow managed to have a working build, even in a very haphazard way. Here’s the thread:

https://discussions.unity.com/t/683556/13

glad you were able to get through, still an issue for me.