Missing Android NDK toolchains directory


on creating a release of my application (Embed assemblies in native code is enabled) i get the following error.

C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(3,3): Error XA5101: Missing Android NDK toolchains directory '\toolchains'. Please install the Android NDK. (XA5101)

Another question is, what is minimum possible size of the apk ?

Thank you very much!


  • Hello, Look at this link, here described as the problem is solved:


  • DavidHowardDavidHoward USMember

    I am getting the same error when trying to build in Release mode, Debug build from TFS works fine, Release build is giving the following error:
    C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets (2010): Missing Android NDK toolchains directory '\toolchains'. Please install the Android NDK.

    The link above does not work

  • BerayBentesenBerayBentesen TRUniversity ✭✭✭✭

    @DavidHoward download NDK and put into that directory. Problem will be fixed.

  • DavidHowardDavidHoward USMember

    Thanks for the reply.
    I have tried that, I downloaded and extracted the Windows 64-bit NDK from http://developer.android.com/ndk/downloads/index.html

    I have extracted it and placed files on the TFS build machine in 'C:\Android\android-ndk'
    I have set a system environment variable to 'NDK_ROOT=C:\Android\android-ndk' (I also tried adding 'ANDROID_NDK_PATH=C:\Android\android-ndk' as I read that is needed somewhere else)

    The TFS Debug build works, compiles and outputs the Android APK, but the Release build fails with the above '\toolchains' error.

    I'm stuck why the Debug configuration would build, yet the Release cant detect the NDK

  • DavidHowardDavidHoward USMember

    Fixed: As an update if anyone else having this problem when building Release (that the NDK \toolchains is missing) it appears that mkbundle is broken.

    The root cause is that "MakeBundleNativeCodeExternal" is true for release and false for Debug. Although this appears as a licensing issue, my build agent has an Enterprise licence installed.

    Disabling "MakeBundleNativeCodeExternal" in Release build by editing the Android project in notepad, seach for 'BundleAssemblies' - and change the 'True' under Release configuration section to ' False' save, build Release, works :smile:

  • ThomasBurkhartThomasBurkhart DEMember ✭✭✭✭

    Still not fixed. Using a local BuildAgent solves the problem

  • JacksonChenJacksonChen USMember ✭✭

    @DavidHoward 's solution works for me, many thanks!

  • RochaPiresRochaPires PTMember ✭✭

    No solution worked for me.
    Any updates on this matter?

  • godcodergodcoder Member

    For those that stumble upon this topic with the same (or a similar) problem:

    I had the NDK installed through the SDK manager and while it seemed like it was installed in the right directory, I suppose Xamarin didn't really want to use that one.

    Moving the NDK folder I downloaded from Google into the same directory the Android SDK was at worked. I cannot post images on the forum sadly, so let me describe how it looked:

    In C:\Program Files (x86)\Android I have these two folders:
    - android-ndk-r19b
    - android-sdk

    The 'android-ndk-r19b' is what you can grab from Google.

    Hope this helps someone in the future to waste less time. :)

Sign In or Register to comment.