错误:在NBI工具链文件夹中找不到前缀为llvm的ABI的工具链 [英] Error: No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

查看:145
本文介绍了错误:在NBI工具链文件夹中找不到前缀为llvm的ABI的工具链的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用gradel(gradlew clean build)编译一个开源android项目(Netguard),但遇到此错误:

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

我进行了搜索,但是没有找到任何帮助.这是主要的build.gradle:

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
}

这是app项目的build.gradle:

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.+'
}

我正在使用gradle-2.9-allandroid-ndk-r10e.我不知道是否要提其他任何内容,因此如果您需要任何信息,请发表评论.

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.

推荐答案

已经过去了两年,现在,如果您遇到这里,可能会遇到如下错误消息:

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

在NBI工具链文件夹中找不到前缀为mips64el-linux-android的ABI的工具链

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

在NBI工具链文件夹中找不到带有前缀mipsel-linux-android的ABI的工具链

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

最新的NDK删除了对mips abi的支持,并且早期版本的android gradle插件仍在检查mips工具链的存在. 有关详细信息,请参见此处.

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.

解决方案:将android gradle插件升级到3.1或更高版本.

Solution: Upgrade android gradle plugin to 3.1 or newer.

例如在项目级别gradle [2018年9月28日]中添加以下内容

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

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

解决方法:创建mipsel-linux-android文件夹结构来欺骗该工具.最简单的方法是将符号链接到aarch64-linux-android-4.9.

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

这篇关于错误:在NBI工具链文件夹中找不到前缀为llvm的ABI的工具链的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆