Building for Android fails

Hello,
Currently I am having an absolute nightmare trying to build an apk file… Whatever I do I keep getting error messges at the start of the build that states either NDK or SDK is missing.

I reinstalled Unity Hub as well as Unity, got the latest (2019.2.14) version, added all the needed modules, still doesn’t work. I even installed other version of Unity, although it didn’t help…

I’m not sure if this is the case, but the issues kind of started at the time I installed Android Studio. Then everything just started to fail constantly when I tried to make a build. Although uninstalling Android Studio program didn’t help, so not sure what to even think at this point.

I’m having the exact same problem with Unity 2019.2.14. Works perfectly with Unity 2019.2.11.

Have tried to make the NDK path point directly to the corresponding NDK folder under the Unity installation, but then I get gradle build errors instead.

Yea I think this is a bug in .14

First thing to do is to manually point to the installed NDK in Unity’s preferences. Assuming you’re using the Unity Hub, its something like:

/Applications/Unity/Hub/Editor/2019.2.14f1/PlaybackEngines/AndroidPlayer/NDK/android-ndk-r16b

Make sure you point to the correct subfolder in NDK, not the NDK folder itself (which is what it seems to default to).

Fix whatever gradle errors by mannualy accepting the sdkmanager licenses, go to its folder in your terminal, for example:

/Applications/Unity/Hub/Editor/2019.2.14f1/PlaybackEngines/AndroidPlayer/SDK/tools/bin

then run ./sdkmanager --licenses and accept everything

Still broken in 2019.2.15