运行我的 android 应用程序时,Android Studio 打印错误:
Error:Execution failed for task ':app:processAndroidArmDebugJniLibs'.
> java.io.FileNotFoundException: <path here>\distribution\wb\lib\x86\libwb.so (The system cannot find the path specified)
它试图访问 x86 库,但我试图将目标平台仅限于 arm 平台。如果我在 app.gradle (gradle-experimental) 文件中将 ${targetPlatform.getName()} 替换为 armeabi,错误就消失了:
model {
repositories {
libs(PrebuiltLibraries) {
wb {
binaries.withType(SharedLibraryBinary) {
sharedLibraryFile = file("${lib_distribution_root}/wb/lib/${targetPlatform.getName()}/libwb.so")
}
}
}
}
android {
// ...
sources {
main {
jniLibs {
dependencies {
library "wb"
}
}
}
}
productFlavors {
create("arm") {
ndk.abiFilters.add("armeabi")
}
}
}
// ...
如何修复构建以便仅使用 arm 库?