[2019.1.4f1] Build failed. Android NDK r13b or newer not detected

Hi,

I installed Unity 2019.1.4f1 via the Hub 2.0.0. Before installation I chose to also install Android SDK & NDK Tools via the Hub.

I imported a project that I cloned from a repo (it was not a newly created project) and I setup everything required to build the .apk. However, when building I received a build error that running il2.cpp.exe failed. The precise error:

“il2cpp.exe didn’t catch exception: System.Exception: Android NDK r13b or newer not detected at ‘D:\Program Files\Unity Editor\2019.1.4f1\Editor\Data\PlaybackEngines\AndroidPlayer\NDK’.”

In Unity’s preferences the NDK is set to that path as well. However, after using the file browser to navigate to that location, I discovered that it is empty (SDK is okay). So I guess the NDK was not installed correctly.

I posted this error to the android forum because this is what led me to the bug. Any ideas on how I should proceed? Install the NDK manually? Oh and by the way, when I try to browse for the sdk or ndk directory in Unity preferences, the “Browse” button simply does nothing. And also, even though I installed the MS Visual Studio via Hub as well, along with the Unity editor, the external script editor was not set to that. It was set to “Open by file extension”.

Thanks!

1 Like

I downloaded the NDK (64 bit) from NDK Downloads  |  Android NDK  |  Android Developers. I took the r19c version. I got different errors this time, so I guess I am making some progress. I believe that I might be using the incorrect version. Do I need to use r13b or something else?

The error:
Editor\2019.1.4f1\Editor\Data\il2cpp\libil2cpp\os\Unity/ExtendedAtomicOps-arm.h:622:17: error: asm-specifier for input or output variable conflicts with asm clobber list

: “cc”, “r2”, “r3”

If I open the project in Unity I also get a popup stating “Unable to find java in the system path.” Tells me to configure JDK in the properties. However the JDK was also downloaded via hub. And the folder and its files exist.

Okay, so I downloaded NDK r13b and installed java jdk and set the path to this new install. Then I got an error that gradle install is not valid. To fix this, I had to go to publish settings and tick the box “Custom Gradle Template”. This seems to have fixed the issue and I can finally build.

It seems that the Unity hub has some issues when installing the 2019.1.4f1 version of Unity with the Android build tools (and sdk & ndk).

Hello,

Sorry for quadruple posting but perhaps this thread should be moved to the section where the topic is Unity Hub.

We are having the same issue with 2019.1.9 :confused:

I use the option to install these things bundled with unity, it works fine, maybe you should try it?

It seems at least on my Mac, the /Applications/Unity/Hub/Editor/2019.1.12f1/PlaybackEngines/AndroidPlayer/NDK folder is empty. And I installed Unity with Unity Hub, and selected Android Build Support, that should include SDK and NDK.

EDIT:
Seems that bug is still active Unity Issue Tracker - Build fails with NDK is not found when choosing to Build & Run on Android