Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

Two years has passed, now if you come across here, you may possibly encounterd error message like this:

No toolchains found in the NDK toolchains folder for ABI with prefix mips64el-linux-android

or

No toolchains found in the NDK toolchains folder for ABI with prefix mipsel-linux-android

Latest NDK removed support for mips abi, and earler version of android gradle plugin still check for the existance of mips toolchain. see here for more info.

Solution: Upgrade android gradle plugin to 3.1 or newer.

e.g. Add following in the project level gradle [28-Sept-2018]

 classpath "com.android.tools.build:gradle:3.2.0"

Workaround: Create mipsel-linux-android folder structure to fool the tool. The easiest way would be to symbolic link to aarch64-linux-android-4.9.

# on Mac
cd  ~/Library/Android/sdk/ndk-bundle/toolchains
ln -s aarch64-linux-android-4.9 mips64el-linux-android
ln -s arm-linux-androideabi-4.9 mipsel-linux-android

Check this thread of three options for solving this kind of issue


I fixed this Error by uninstalling the NDK in the SDK-Tools. So, if you don't need the NDK, uninstall it.


For Android studio 3.2.1+

Upgrade your Gradle Plugin

classpath 'com.android.tools.build:gradle:3.2.1'

If you are now getting this error:

Could not find com.android.tools.build:gradle:3.2.1.

just add google() to your repositories, like this:

repositories {
    google()
    jcenter()
}

I have faced the same problem while update Android studio from 2.0 to 2.1 in my Windows 8 machine.

I found a solution for that.Please use the following steps.

  1. Download the android NDK for windows from https://developer.android.com/ndk/downloads/index.html.
  2. Extract the same and copy the "toolchain" folder from the bundle.
  3. Paste the folder under installed NDK folder under C:\android-sdk-win\ndk-bundle.[Installed the path may vary based on your installation]
  4. Restart android studio.

This is happening because Android studio won't gets full NDK update in the stable channel. If you are not using NDK for your project development you can simply remove the NDK folder from your SDK directory.


Error message:

No toolchains found in the NDK toolchains folder for ABI with prefix: llvm.

After fresh web installation of Android Studio with NDK, I imported an Android code sample that used NDK from GitHub and tried to compile it.

As a result had an Error:

No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

Solution: for some reasons standard installation process on macOS had failed to install a complete set:

~/Library/Android/sdk/ndk-bundle had missed folder toolchains with all tools,

(it should be like this: ~/Library/Android/sdk/ndk-bundle/toolchains)

The solution was to download NDK separately, open it, copy folder toolchain and paste it to the folder:

~/Library/Android/sdk/ndk-bundle

Step-by-step:

1) Open the page with old NDK versions:

https://developer.android.com/ndk/downloads/older_releases

enter image description here

2) Agree the Terms:

enter image description here

3) Download the older version of NDK (for example 16b):

enter image description here

4) Open your toolchains directory.

5) Transfer files that you need from toolchains folder of downloaded zip-file to your toolchains folder:

enter image description here

6) Rebuild the Project:

enter image description here


UPD 30 Sep 2018:
I used Android NDK Revision r16b for fix this error in my own case. So I present the example with this version.
But it's better to use the Android NDK, Revision r17c (June 2018). It is the last one, supporting mips (reasonable reccomendation from Weekend's comment).


Without downloading, copying, or symlinking anything, I was able to "fix" the error by simply creating an empty directory where the older version of the Android Gradle plugin expects the removed mips toolchain:

mkdir -p $ANDROID_HOME/ndk-bundle/toolchains/mips64el-linux-android/prebuilt/linux-x86_64

Obviously, $ANDROID_HOME points to the root of the Android SDK installation here. If you are using MacOS, replace linux-x86_64 with darwin-x86_64 in the command above. On Windows use windows-x86_64.