0

Getting an error when trying to fix error -

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

Do not want to upgrade as afraid it might break my application and need to use NDK to work with C++.

After following steps for workaround to fix the error - Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

New error:

Expected caller to ensure valid ABI: MIPS

Any help on how to fix the issue.

shizhen
  • 12,251
  • 9
  • 52
  • 88
cole
  • 3,147
  • 3
  • 15
  • 28

2 Answers2

2

You should specify an ABI filter.

You haven't mentioned how you are building. If you're using Gradle, then you put something like this in the defaultConfig block in your build.gradle:

ndk {
    abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64'
}

If you're invoking ndk-build directly, then you put this on the ndk-build command line:

APP_ABI=armeabi-v7a arm64-v8a x86 x86_64

Or inside your Application.mk:

APP_ABI := armeabi-v7a arm64-v8a x86 x86_64

The ABI filter I showed is just an example. It's up to you to decide which ones you want to build for. arm64-v8a and armeabi-v7a are by far the most common ones among Android devices.
mips, mips64 and armeabi are no longer supported by the NDK.

Michael
  • 57,169
  • 9
  • 80
  • 125
  • buildTypes { debug { ndk { abiFilters 'armeabi-v7a','arm64-v8a','x86','x86_64' //abiFilters ABI_FILTERS } } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } – cole Jan 31 '19 at 16:15
  • I just started a new project and added NDK on complain from android studio and getting these error. I tried to add ndk in my project using your above methods. But its not working. – cole Jan 31 '19 at 16:17
  • Why did you add the ABI filter only for the `debug` build type instead of for all build types? – Michael Jan 31 '19 at 16:21
  • I was just testing not sure but irrespective it giving me same error on buildtypes or build. – cole Jan 31 '19 at 16:24
  • You can also update your gradle plugin version to one that doesn't have this problem. – Dan Albert Jan 31 '19 at 17:07
  • Thanks Micahel it works now. I needed to call ndk in android { – cole Feb 01 '19 at 15:09
1

From your TOP-LEVEL build.gradle, change your classpath for android gradle plugin to 3.2.1 or higher.

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

Or for other options, please check here: Three options for solving this kind of issue

shizhen
  • 12,251
  • 9
  • 52
  • 88