编译Android项目时出现如下错误,请问是什么原因导致的?
“错误:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)”
我的 Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "facebook.f8demo"
minSdkVersion 20
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-frtti -fexceptions -std=c++11"
}
}
ndk {
// Specifies the ABI configurations of your native
// libraries Gradle should build and package with your APK.
abiFilters 'armeabi-v7a'
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar', '*.so'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
项目源代码Caffe2AICamera
最佳答案
对我来说,我使用的是 Android-25,但我必须使用 arm64-v8a,因为它是 64 位的。我认为 armeabi-v7a 是 32 位的。有关 Android 上 ABI 管理的详细信息,请参见:https://developer.android.com/ndk/guides/abis.html
关于安卓错误 :error: linker command failed with exit code 1 (use -v to see invocation) build error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44250373/