Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

Discussion in 'Android' started by Wattosan, May 29, 2019.

  1. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    456
    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!
     
    macagu likes this.
  2. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    456
    I downloaded the NDK (64 bit) from https://developer.android.com/ndk/downloads. 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.
     
    Last edited: May 29, 2019
  3. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    456
    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).
     
  4. Wattosan

    Wattosan

    Joined:
    Mar 22, 2013
    Posts:
    456
    Hello,

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

    elhispano

    Joined:
    Jan 23, 2012
    Posts:
    52
    We are having the same issue with 2019.1.9 :/
     
  6. JustAnotherDude

    JustAnotherDude

    Joined:
    Oct 28, 2013
    Posts:
    279
    I use the option to install these things bundled with unity, it works fine, maybe you should try it?
     
  7. kaarloew

    kaarloew

    Joined:
    Nov 1, 2018
    Posts:
    360