gpt4 book ai didi

android - 错误 : No toolchains found in the NDK toolchains folder for ABI with prefix: llvm

转载 作者:IT老高 更新时间:2023-10-28 12:53:28 26 4
gpt4 key购买 nike

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

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:

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。我不知道我是否应该提及其他任何内容,如果您需要任何信息,请发表评论。

最佳答案

两年过去了,现在如果你遇到这里,你可能会遇到这样的错误信息:

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

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

最新的 NDK 移除了对 mips abi 的支持,并且早期版本的 android gradle 插件仍然检查 mips 工具链的存在。 see here for more info .

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

例如在项目级别的 gradle 中添加以下内容 [28-Sept-2018]

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

解决方法:创建 mipsel-linux-android 文件夹结构来欺骗工具。最简单的方法是符号链接(symbolic link)到 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

查看 three options for solving this kind of issue 的这个帖子

关于android - 错误 : No toolchains found in the NDK toolchains folder for ABI with prefix: llvm,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35128229/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com