277

I want to compile an open source android project (Netguard) using gradel (gradlew clean build) But I encountered this Error:

A problem occurred configuring project ':app'.
> Exception thrown while executing model rule: NdkComponentModelPlugin.Rules#cre
ateToolchains
   > No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

I serached but didn't find enything helping. Here is the main build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle-experimental:0.6.0-alpha1'
    }
}
allprojects {
    repositories {
        jcenter()
    }
}
task clean(type: Delete) {
    delete rootProject.buildDir
}

And here is the build.gradle of the app project:

apply plugin: 'com.android.model.application'

model {
    android {
        compileSdkVersion = 23
        buildToolsVersion = "23.0.2"

        defaultConfig.with {
            applicationId = "eu.faircode.netguard"
            minSdkVersion.apiLevel = 21
            targetSdkVersion.apiLevel = 23
            versionCode = 2016011801
            versionName = "0.76"
            archivesBaseName = "NetGuard-v$versionName-$versionCode"
        }
    }
    android.ndk {
        moduleName = "netguard"
        toolchain = "clang"
        ldLibs.add("log")
    }
    android.sources {
        main {
            jni {
                source {
                    srcDir "src/main/jni/netguard"
                }
                exportedHeaders {
                }
            }
        }
    }
    android.buildTypes {
        release {
            minifyEnabled = true
            proguardFiles.add(file('proguard-rules.pro'))
            ndk.with {
                debuggable = true
            }
        }
    }
    android.buildTypes {
        debug {
            ndk.with {
                debuggable = true
            }
        }
    }
    android.productFlavors {
        create("all") {
        }
    }
}

dependencies {


compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.1.+'
    compile 'com.android.support:recyclerview-v7:23.1.+'
    compile 'com.squareup.picasso:picasso:2.5.+'
}

And I'm using gradle-2.9-all and android-ndk-r10e. I don't know if I should mention anything else, so comment if you need any information.

Saeed
  • 7,262
  • 14
  • 43
  • 63
  • Try to update the gradle tools. classpath 'com.android.tools.build:gradle:3.2.0-beta05' – Photon Point Aug 13 '18 at 07:50
  • use https://developer.android.com/ndk/downloads/older_releases and Android NDK, Revision 16b (December 2017) version to download required folders and fix the issue. – Panache Oct 02 '18 at 09:15
  • Check this thread of [**three options** for solving this kind of issue](https://stackoverflow.com/a/51852529/8034839) – shizhen Feb 01 '19 at 04:59

55 Answers55

416

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

shizhen
  • 12,251
  • 9
  • 52
  • 88
don't panic
  • 6,033
  • 2
  • 17
  • 15
  • 8
    Tried with gradle 4.1, didn't work, but workaround (creation of folder mipsel-linux-android-dummy) worked. Thanks @lazybug. –  Sep 09 '18 at 02:54
  • 2
    @Girish upgrade **Android Gradle Plugin** in top level `build.gradle` file, something like `com.android.tools.build:gradle:3.2.0-rc02`, not Gradle version – don't panic Sep 10 '18 at 08:52
  • 4
    The Workaround mentioned here is the correct one: `# 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` – Avijeet Dutta Oct 03 '18 at 03:43
  • 22
    On Windows: `mklink /d mips64el-linux-android aarch64-linux-android-4.9` and `mklink /d mipsel-linux-android arm-linux-androideabi-4.9` worked for me too. – Mitch Oct 07 '18 at 06:02
  • The "on Mac" workaround works fine (adapt ~/Library part). But the next update of NDK (2018 Oct 14) found a whole bunch of unexpected files in the mips* trees. Not surprising. So I removed the symbolic links again. – Quigi Oct 15 '18 at 06:45
  • On windows create this folder structure to solve the error: `Android\sdk\ndk-bundle\toolchains\mips64el-linux-android\prebuilt`. – Darush Oct 20 '18 at 08:38
  • worked for me : classpath "com.android.tools.build:gradle:3.2.0" – sssvrock Nov 02 '18 at 09:58
  • From the cited link under 'see here for more info': "You will also need to upgrade to Android Studio 3.1 or newer." - Make sure you do that. – marknuzz Nov 14 '18 at 06:47
  • I upgraded to AS 3.2.1 and got this stupid dependency failure even though the project I'm building doesn't use NDK. I upgraded the project Gradle as per the instructions in https://stackoverflow.com/questions/17727645/how-to-update-gradle-in-android-studio and went through two passes of upgrades, including tools. Finally AS is back to baseline functionality. Gradle's purpose is to make these build problems go away, but maintaining Gradle is its own source of the problems. – Matthew Nov 14 '18 at 20:45
  • Worked like a charm! Had exactly the same situation: forked a git project with implicit classpath 'com.android.tools.build:gradle:3.0.0' in build.gradle. Changed to classpath 'com.android.tools.build:gradle:3.2.1' and everything started to compile fine. – Alex Burov Nov 22 '18 at 14:52
  • Not working for me "ERROR: Expected caller to ensure valid ABI: MIPS". – Swapnika Jan 30 '19 at 09:21
  • The work around no longer works in android studio 3.3 on mac. After creating symbolic links receiving an index out of bounds -1 error during the gradle sync. Very frustrating there is zero support for older gradle version, I thought the point of using a wrapper was to avoid this. – James DeRagon Mar 21 '19 at 16:33
  • Creating twice symbolic links solved my problem on MacOS, Android Studio 3.3. – Itoun Apr 15 '19 at 07:26
  • 1
    You can check your native dependencies' SO files, if any. It may contain SO for MIPS that is not supported anymore, thus making NDK fail. Removing those SO files for MIPS is safe, and it will make error disappear. – fobo66 Sep 24 '20 at 08:27
  • 1
    For me works this https://github.com/flutter/flutter/issues/76393#issuecomment-836625949 – Matias de Andrea Dec 22 '21 at 07:32
101

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

Robert Columbia
  • 6,313
  • 15
  • 32
  • 40
Herzi
  • 1,051
  • 1
  • 6
  • 3
71

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()
}
Nimantha
  • 6,405
  • 6
  • 28
  • 69
Nikunj Paradva
  • 15,332
  • 5
  • 54
  • 65
39

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.

Nithinjith
  • 1,775
  • 18
  • 40
  • 1
    Works with Android Studio 3.2! – maxwellnewage Oct 02 '18 at 15:13
  • 1
    This also worked for me for fixing the error "`Error : Android MIPS ToolChain directory "" does not exist`" in Game Maker Studio 2 on a Mac. But I needed to get version 17c of the NDK from here : https://developer.android.com/ndk/downloads/older_releases (as per: https://www.reddit.com/r/gamemaker/comments/9m958a/no_toolchains_found_in_the_ndk_toolchains_folder/) Thank You @nithinjith ! ... still not building however, need to solve : `Android NDK: Please fix the APP_ABI definition in /Users/../Library/Android/sdk/ndk-bundle/build/core/default-application.mk ` – kris Oct 27 '18 at 05:56
37

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
Nimantha
  • 6,405
  • 6
  • 28
  • 69
  • in my case it's there but no file there with prefix _aarch64-linux-android_. Any suggestion !! – CoDe Jul 28 '17 at 03:17
  • folder 'mips64el-linux-android-4.9' & 'mipsel-linux-android-4.9' are not available after ndk bundle 16, so i have to download and add these two folder in android sdk bundle inside toolchains folder hence issue solved, still didn't understand why this error? – Fazal Oct 29 '18 at 08:42
  • Check this thread of [**three options** for solving this kind of issue](https://stackoverflow.com/a/51852529/8034839) – shizhen Feb 01 '19 at 05:03
27

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).

V.March
  • 1,820
  • 1
  • 21
  • 30
  • Instead of `(for example 16b)`, it's better to clarify which NDK version is the last one supporting mips. via [release note of Android NDK Revision r17c (June 2018)](https://developer.android.com/ndk/downloads/revision_history): _Support for ARMv5 (armeabi), MIPS, and MIPS64 has been removed. Attempting to build any of these ABIs will result in an error._ It's `16b` exactly. – Weekend Sep 30 '18 at 06:02
  • @Weekend Thanks for your recommendation. I added it to my answer. – V.March Sep 30 '18 at 19:37
  • 1
    @vmarch Sorry but **It's `16b` exactly.** r17c is the first version which **removed** the support for MIPS :) – Weekend Oct 08 '18 at 07:10
  • 1
    @Oh, I read your previous comment so very quickly. That's why I missed the point. My apologize! But these files are still present in the Android NDK, Revision r17c (June 2018). And in version 18 they were finally removed. Just look into the archive. https://developer.android.com/ndk/downloads/older_releases#ndk-17c-downloads – V.March Oct 08 '18 at 14:15
  • @vmarch Well done! I didn't check r17c archive, just inferred the previous conclusion from release notes. – Weekend Oct 09 '18 at 02:03
  • awesome solution - exactly what I needed. – Adam Ivancza Nov 09 '18 at 18:19
19

The best solution for this problem is:

  1. Go to SDK Manager.

  2. Next choose SDK tools.

  3. Unselect NDK (side by side).

  4. Apply and OK.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
18

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.

friederbluemle
  • 33,549
  • 14
  • 108
  • 109
16

I uninstalled the NDK since I didn't need it . Go to SDK manager on Android studio ( Tools -> Android -> SDK Manager ) . If NDK is installed . Just uncheck the box and click OK . The installed components will be deleted .

diptia
  • 2,135
  • 21
  • 21
9

In my case, this error occured when creating a new Android Studio (Android studio 3.2.1) Java Project with

    classpath 'com.android.tools.build:gradle:2.0.0-beta6'

So I´ve downgraded to

       dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
      }

Not the best solution stay at an older version, but maybe it´s just a temporary bug in the beta as the NDK path in local.properties is still the same, but the IDE doesn´t complain anymore

Shomu
  • 2,734
  • 24
  • 32
Marian Klühspies
  • 15,824
  • 16
  • 93
  • 136
7

Android NDK 18.0* seems has an issue not creating all the files in folders after extraction. Due to it, your app compilation will fail which uses ndk builds.

Better is to use NDK 17.1* (https://developer.android.com/ndk/downloads/) etc version and you can extract or use the android studio extraction to ndk-bundle by default will work good.

appapurapu
  • 602
  • 7
  • 6
7

To resolve the issue just go to:

tools->Sdk Manager -> Android Sdk -> SDK Tools in Android Studio and Uncheck the NDK versions and only select 20.1.5948944 version and install that. enter image description here

I resolved the same issue in linux(Ubuntu) machine using this technique.

Abdul ahad
  • 1,383
  • 7
  • 18
5

Open Android Studio, Go to Tools then Android and then SDK, uncheck NDK If you do not need this, and restart android studio.

Muhammad Bilal
  • 1,008
  • 13
  • 14
5

[https://github.com/tensorflow/tensorflow/tree/master/tensorflow/examples/android][1]

For people trying out this example and facing issues with latest NDK. Can follow this solution. In build.gradle change this

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

To

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

The reason is mips are deprecated in the latest ndk versions, Gradle version 3.1.2 will not have a compulsion for mips. It assumes the presence for these missing folders.

Sujith Royal
  • 762
  • 10
  • 9
5

The simple solution is download and extract the following file which contains mips64el-linux-android-4.9 and mipsel-linux-android-4.9 folders,to your toolchains folder inside sdk "android-sdk\ndk-bundle\toolchains".

Downlod this file and extraxt to toolchains foolder

  • Extract and then execute # 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 – hoanghuychh Dec 22 '21 at 02:27
4

When compiling a project in android studio, I occasionally encounter:

Error: No toolchains found in the NDK toolchains folder for ABI with prefix: arm-linux-androideabi/llvm

This may be caused by updating related components. The solution is to Android studio ( Tools -> Android -> SDK Manager ) . Select the ndk item and delete it. If the program needs it, you can re-install it. This will ensure that the folder location is correct and there will be no such problem.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
0xAliHn
  • 18,390
  • 23
  • 91
  • 111
4

After looking around, the solution was to remove the NDK designation from my preferences.

Android Studio → Preferences → System Settings → Android SDK → SDK Tools → Unselect NDK → Apply button.

Project and Gradle compiled fine after that and I was able to move on with my project work.

As far as why this is happening, I do not know but for more info on NDK check out:

Raza Baloch
  • 334
  • 4
  • 9
4

Had the same issue. Installed latest NDK rc version by default. Latest stable release fixed the issue. enter image description here

arturas
  • 1,027
  • 1
  • 9
  • 26
4

Uninstalling the ndk solve the problem for me.

Wai Yan
  • 137
  • 1
  • 9
3

I've had a similar problem, but I wanted to use NDK version r9d due to project requirements.

In local.properties the path was set to ndk.dir=C\:\\Android\\ndk\\android-ndk-r9d but that lead to the problem:

No toolchains found in the NDK toolchains folder for ABI with prefix: [toolchain-name]

The solution was to:

  1. Install the newest NDK using sdk manager
  2. Copy the missing toolchain [toolchain-name] from the new ndk to the old. In my case from sdk\ndk-bundle\toolchains to \ndk\android-ndk-r9d\toolchains
  3. Repeat the process till all the required toolchains are there

It looks to me that the copied toolchains are not used, but for some reason it is needed to for them be there.

Marcin Kunert
  • 5,596
  • 5
  • 26
  • 52
3

Solved it by adding google() dependency into both repositories in build.gradle(Project: ProjectName). then sync your project

buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.3.2'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        google()
        jcenter()
    }
}
shizhen
  • 12,251
  • 9
  • 52
  • 88
Zain
  • 37,492
  • 7
  • 60
  • 84
3

In your project level Gradle file increase the dependencies classpath version low to high like

dependencies {
        classpath 'com.android.tools.build:gradle:3.0.0'
    }

to change like

dependencies {
        classpath 'com.android.tools.build:gradle:3.2.1'
    }
2

I solved this question by unInstalled ndk, becasuse I dont't need it

alpha
  • 71
  • 7
2

I navigated to local.properties, and in there the

ndk.dir=/yo/path/for/NDK

line needs to be updated to where your ndk lies.

I was using Crystax NDK, and didn't realize the original Android NDK was still in use.

2

Find your own local android-SDK, if you download the relevant SDK of ndk, there will be a folder called "ndk-bundle"

enter image description here

There is a folder called "toolchains" inside.

enter image description here

We noticed that there are no mips64el related files inside.

enter image description here

The solution is as follows:

Click here to download the NDK package separately through the browser. After unzipping, open the "toolchains" folder, compare it with the android-sdk->ndk-bundle->toolchains folder, find the missing folder, copy the past three. Recompile, the problem is solved.

halfer
  • 19,824
  • 17
  • 99
  • 186
Prince Dholakiya
  • 3,255
  • 27
  • 43
2

To fix it like i did

Android Studio File> project structure and go to project

change Gradle version to 4.6 & Android plugin version to 3.2.1

check screenshot

then clean project if you got this Error "Could not find aapt2-proto.jar"

go to build.gradle (project)

Try moving the google() method (.gradle file) to the top of its execution block the order of repositories it searches in that causes the issue.

for example, change this:

repositories {
  maven { url 'https://maven.fabric.io/public' }
  google()      <===  from here
  mavenCentral()
}

To this:

repositories {
  google()     <===  to here
  maven { url 'https://maven.fabric.io/public' }
  mavenCentral()
}

Make those changes in both "buildscript" and "allprojects "

check screenshot

If you didn't find google() add it

Bachlil
  • 21
  • 1
2

For Android Studio 3.2.1 Update your

Gradle Version 4.6

Android plugin version 3.2.1

Masum
  • 4,879
  • 2
  • 23
  • 28
2

The issue comes mostly when you are cloning a previous project specially from github. What you can do is

  1. Change the classpath to

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

in your project level gradle.

  1. Then Change all the instances of compile with implementation except compileSdkVersion keep it as it is in your app level gradle.

  2. Instead of sync now click on make project(Ctrl+F9)

  3. Add google maven repositories if needed.

  4. Upgrade the gradle wrapper if needed.

(Android Studio IDE will ask / guide you with the same for steps 4 and 5)

Nimantha
  • 6,405
  • 6
  • 28
  • 69
2

I try to solve the problem using following method:

  1. Stay Android build tools version the same with gradle version. For example:if you use the build tools version is 3.3.0,your gradle version must be 4.10.1.You can reference by the link https://developer.android.com/studio/releases/gradle-plugin and chagne your build tools & gradle version in your AS(File->Project Structure->Project)

  2. If method1 don't work,you can custom your ndk toolchains version to solve the problem :like download ndk18 or ndk16 , setting the ndk path is your AS(File->Project Structure->SDK Location->Android NDK Location)

Nimantha
  • 6,405
  • 6
  • 28
  • 69
廖志伟
  • 69
  • 1
  • 5
2

Navigate to C:\Users\lalit\AppData\Local\Android\Sdk\ndk-bundle\toolchains.

Now, find the folder name aarch64-linux-android-4.9 and rename it to mips64el-linux-android.

Re-run the android app.

Paul Roub
  • 36,322
  • 27
  • 84
  • 93
2

Delete all your NDK in sdk tools.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
sunjenry
  • 141
  • 1
  • 4
1

For me I think there might be some issue in installing android NDK from android studio. I was able to resolve this in following manner

Downloaded android ndk from

https://developer.android.com/ndk/downloads/index.html

and placed inside ndk-bundle (where your android sdk is installed ). For more info check this screens.

https://app.box.com/s/dfi4h9k7v4h0tmbu3z9qnqx3d12fdejn

Chirag Purohit
  • 731
  • 11
  • 20
1

If you don't use the NDK, unset the environment variable ANDROID_NDK_HOME.

Cristan
  • 12,083
  • 7
  • 65
  • 69
1

I fixed the issue by reinstalling the NDK.

c__c
  • 1,574
  • 1
  • 19
  • 39
1

If you are using Ionic 3 Remove ndk from android studio sdk tools.

Taimoor Tariq
  • 405
  • 5
  • 5
  • Great, as a temporary solution for the specific need of building ionic android projects, although is not ideal. – MFAL Oct 12 '18 at 08:12
1

Open your buldle.gradle file and upgrade the versions for following both classpath:

classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'

Then Sync and after get one dialog for update Gradle version as well then click that link and wait for download all required updates.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
1

First, try updating the ndk version https://developer.android.com/ndk/downloads/

If that's not working then you can try the following:

  • Create a folder

    Go to the Sdk\ndk-bundle\toolchains folder (in my case its C:\Users\USER\AppData\Local\Android\Sdk\ndk-bundle\toolchains; you can find yours under File->project structure->SDK location in you android studio) and create a folder with the name that's shown as missing in the error for eg: if the error is

    Gradle sync failed: No toolchains found in the NDK toolchains folder for ABI with prefix: mipsel-linux-android

    Then create a folder with name mipsel-linux-android

  • Include content Go to the Sdk\ndk-bundle\toolchains folder again and open any folder that's already in it. For example:Sdk\ndk-bundle\toolchains\aarch64-linux-android-4.9 (in mycase C:\Users\USER\AppData\Local\Android\Sdk\ndk-bundle\toolchains\aarch64-linux-android-4.9) copy the prebuilt folder in it to the folder we created in the last step

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Dismi Paul
  • 187
  • 1
  • 5
1

NOTE: This answer seems to be specific to: No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android, but it was linked here by:

* https://stackoverflow.com/questions/52193274/no-toolchains-found-in-the-ndk-toolchains-folder-for-abi-with-prefix-mips64el-l

From NDK r19b:

more ~/Android/Sdk/ndk-bundle/CHANGELOG.md
  • This version of the NDK is incompatible with the Android Gradle plugin version 3.0 or older. If you see an error like No toolchains found in the NDK toolchains folder for ABI with prefix: mips64el-linux-android, update your project file to [use plugin version 3.1 or newer]. You will also need to upgrade to Android Studio 3.1 or newer.
Sooth
  • 2,834
  • 23
  • 26
1

In my case some supporting file was missing in new NDK version "23.0.7599858" so i downgraded the version to "22.1.7171670".You can also find all the downloaded version of NDK at "../Sdk/ndk".

android {
compileSdkVersion 30
buildToolsVersion "29.0.2"

defaultConfig {
    ...
    ...
    ndkVersion "22.1.7171670"
}
Siva K
  • 33
  • 6
1

Add the below line in local.properties(SDK Location)

ndk.dir=C\:\\Users\\<username>\\AppData\\Local\\Android\\Sdk\\ndk-bundle
Ramesh R
  • 7,009
  • 4
  • 25
  • 38
0

The steps I have followed to fix the issue are as follows:

  1. Analyze -> Code Cleanup

  2. File -> Project Structures -> Select project from the list and update the gradle version to latest.

  3. Build -> Clean Project

  4. Build -> Make Project

Now the issue related to the build may get reported like using compile instead of implementation etc.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Ajay Kumar Meher
  • 1,932
  • 16
  • 24
0

If you want to add NDK in your project then follow below steps:

  1. If you installed NDK using SDK Manager then uninstall first. (untick from SDK tools and apply)
  2. Download manually NDK from its official site. (any version) if project old then prefer version 17.
  3. Extract that file.
  4. Go to your project structure > NDK path > add Extracted file path here.
  5. Build Project.
Nimantha
  • 6,405
  • 6
  • 28
  • 69
Gunavant Patel
  • 1,413
  • 1
  • 13
  • 17
0

Upgrade your Gradle Plugin

  1. com.android.tools.build:gradle:3.1.4
    Upgrade gradle wraperpropeties

    distributionUrl=https://services.gradle.org/distributions/gradle-4.4-all.zip

RAHULRSANNIDHI
  • 527
  • 6
  • 20
0

Open android/gradle/gradle-wrapper.properties and change this line: distributionUrl=

https\://services.gradle.org/distributions/gradle-4.1-all.zip

to this line:

distributionUrl=

https\://services.gradle.org/distributions/gradle-4.4-all.zip

Open android/build.gradle and change this line:

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

to this:

classpath 'com.android.tools.build:gradle:3.1.2'
Ahsan Ajmal
  • 115
  • 7
0

Update project gradle version

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

Update app gradle:implementation 'com.android.support:appcompat-v7:28.0.0' implementation 'com.android.support:design:28.0.0'

Soumen Das
  • 1,292
  • 17
  • 12
  • this worked with gradle-wrapper.properties url set to https\://services.gradle.org/distributions/gradle-4.4-all.zip – ir2pid May 26 '19 at 19:22
0

Uninstall the older version of SDK from IntellJ IDEA -> Appearance -> System Settings -> Android SDK -> SDK platforms.

Install the new Android SDK version whatever version you want.

While installing the new SDK, uncheck the NDK checkbox under SDK tools.

Cody Gray - on strike
  • 239,200
  • 50
  • 490
  • 574
0

Just upgrade you Android Studio with latest version >> connect with the internet for download content according to your project.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Dmax
  • 1
  • 1
0

link file is not good for me.

ln -s aarch64-linux-android-4.9 mips64el-linux-android
ln -s arm-linux-androideabi-4.9 mipsel-linux-android

Because there is another error.

* What went wrong:
A problem occurred configuring project ':Test'.
> Expected caller to ensure valid ABI: MIPS

Add this in defaultConfig if you build with gralde

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

If you use ndk-build command, add this in Application.mk.

APP_ABI := armeabi-v7a arm64-v8a x86 x86_64
Victor Choy
  • 4,006
  • 28
  • 35
0

To continue with your older gradle version, we can use below solution:

Notice the file android-ndk-r17-beta2/toolchains/mips64el-linux-android- 4.9/prebuilt/darwin-x86_64/NOTICE-MIPS64. The content of the file is below.

This mips64el-linux-android-4.9 directory exists to make the NDK compatible with the Android SDK's Gradle plugin, version 3.0.1 and earlier, which expects the NDK to have a MIPS64 toolchain directory.

So, i can say, using Android SDK's Gradle plugin above 3.0.1, or create even a directory marked with 'mipsel' and 'mips64el', can both resolve the problem. The latter method is below.

cd "path-to-ndk"

OS_=$(uname -s | tr [A-Z] [a-z])
mkdir -p toolchains/mipsel-linux-android-4.9/prebuilt/${OS_}-x86_64
touch toolchains/mipsel-linux-android-4.9/prebuilt/${OS_}-x86_64/NOTICE-MIPS
mkdir -p toolchains/mips64el-linux-android-4.9/prebuilt/${OS_}-x86_64
touch toolchains/mips64el-linux-android-4.9/prebuilt/${OS_}-x86_64/NOTICE-MIPS64

Got the solutions from here

SANAT
  • 8,489
  • 55
  • 66
0

First go to SDK folder by using following location C:\Users\CHALAKMIAN\AppData\Local\Android\Sdk find Ndk folder and delete it. Know run your project

0

Use this option to filter out wish Abi prefix to be used:

android {
    defaultConfig {
        ndk {
            abiFilters 'arm64-v8a', 'x86_64', ...
        }
    }
}
kimo_ouz
  • 323
  • 4
  • 7
0

Update your gradle to

In your gradle-wrapper.properties file

distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip

And in your android/build.gradle file

dependencies {
        ...
        classpath 'com.android.tools.build:gradle:7.1.2'
        ...
    }
Solomon Darku
  • 357
  • 2
  • 6
-1

Update classpath 'com.android.tools.build:gradle:X.X.X' in Project Build.Gradle and replace X to the latest version you have.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
A.R.B.N
  • 1,035
  • 2
  • 10
  • 20
-1

Change gradle version of project-label .gradle file to Latest:

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

and add these checks on app label .gradle file:

packagingOptions{
    doNotStrip '*/mips/*.so'
    doNotStrip '*/mips64/*.so'
}
Nimantha
  • 6,405
  • 6
  • 28
  • 69
Prinkal Kumar
  • 3,196
  • 2
  • 10
  • 15
-1

Download an older version of the NDK (14b) and go to Android Studio to File | Project Structure and select it.

Nimantha
  • 6,405
  • 6
  • 28
  • 69
Philip
  • 1