NDK not found at specified location

12,273

Solution 1

When using Xamarin Studio, if you are getting the error XA5101 error ("Missing Android NDK toolchains directory") you would need to download the Android NDK separately from:

http://developer.android.com/tools/sdk/ndk/index.html

Then he should unzip downloaded file and open the Xamarin IDE and go to the following menu location:

Tools ==> Options ==> SDK Locations ==> Android

Select the location of the unzipped folder.

Then close the IDE and reopen it (force close/restart if it persists in task/process manager).

Alternate to try:

Not finding NDK may also be caused because of mismatched configuration for AVD Manager. More specifically, the Xamarin may be creating devices & AVDs in your %USERPROFILE%.android while the debugger/runtime emulation EXPECTS the AVDs in the ADT directory. You can try copying ZAVD2-related files and directories into the %USERPROFILE%.android\avd and see if that resolves the issue.

===== Initial post ======

[In case of eclipse] I think the answer is here: https://stackoverflow.com/a/11825963/918535

//goto Preference → Android → NDK and choose your ndk location

//If your NDK location is already set, the builder in the toolchain editor may be wrong. Go to project properties, C/C++ Build | Tool Chain Editor and select Android Builder as current builder.

// in your .bashsrc file, you may also need to add the env variable:

NDK_HOME=/opt/android-ndk-r8
export NDK_HOME

Solution 2

In case this catches anyone else out, I had this issue but it was because I checked "Enable AOT (Experimental)" in the Android Build Code Generation settings. This setting is off by default so probably should have left well enough alone.

Solution 3

Okay, so I found the issue. There was no ndk-stack.exe file in my NDK location. I was thinking I would delete/uninstall everything related to NDK and reinstall. This is when I came upon ndk-build.cmd, just thought id click it since it was a cmd, and it created the ndk-stack.exe at a location on my computer which was found by both the Xamarin studio and Visual Studio( noticed later that even VS couldnt find the NDK but after the cmd, it did). Thank you for the help.

Share:
12,273
Admin
Author by

Admin

Updated on June 04, 2022

Comments

  • Admin
    Admin about 2 years

    After installing Xamarin Studio I went to the options to make sure the Android SDK, JDK and NDK were all found. The first two in fact were, but the NDK was not found. It asked to specify location, and I did specify the location (when I clicked "browse" it took me to the folder where the NDK actually was). Yet, it still does not recognize it and says NDK not found at the specified location.

  • William Barbosa
    William Barbosa almost 9 years
    He's not using Eclipse, he's on Xamarin Studio
  • Jahmic
    Jahmic almost 5 years
    <AotAssemblies>true</AotAssemblies> in the csproj. Good catch. More of a workaround until getting NDK setup correct.