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

前端 未结 30 2455
猫巷女王i
猫巷女王i 2020-11-27 09:45

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

A problem occurred          


        
相关标签:
30条回答
  • 2020-11-27 09:58

    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

    0 讨论(0)
  • 2020-11-27 10:00

    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.

    0 讨论(0)
  • 2020-11-27 10:00

    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.

    0 讨论(0)
  • 2020-11-27 10:01

    Step-by-step:

    1) Open the page with old NDK versions:

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

    2) Agree the Terms:

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

    4) Open your toolchains directory.

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

    6) Rebuild the Project:


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

    0 讨论(0)
  • 2020-11-27 10:02

    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.

    0 讨论(0)
  • 2020-11-27 10:03

    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)

    it fixes!! Enjoy Coding

    0 讨论(0)
提交回复
热议问题