我得到了这个:
错误:在OS独立路径中发现多个文件< lib / armeabi-v7a / libopencv_java3.so'
我尝试将这段代码放在我的gradle中:
packagingOptions{
exclude 'lib/armeabi-v7a/libopencv_java3.so'
}
然后我收到此错误:
错误:在操作系统独立路径中找到了多个文件< lib / armeabi-v7a / libMyLibs.so'
所以我补充说:
packagingOptions{
exclude 'lib/armeabi-v7a/libopencv_java3.so'
exclude 'lib/armeabi-v7a/libMyLibs.so'
}
它构建得很好,但是我无法在我的设备上安装它,因为我收到了这个错误:
无法完成会话:INSTALL_FAILED_NO_MATCHING_ABIS:无法提取本机库,res = -113
这意味着它无法安装在此类架构上。所以我不认为排除armeabi-v7a就是答案。
这是我在Gradle中所拥有的:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.citytelecoin.opencvfacetest"
minSdkVersion 23
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
sourceSets.main {
jni.srcDirs = [] //disable automatic ndk-build call
}
task ndkBuild(type: Exec, description: 'Compile JNI source via NDK') {
commandLine "/home/liane/Android/Sdk/ndk-bundle/ndk-build",
'NDK_PROJECT_PATH=build/intermediates/ndk',
'NDK_LIBS_OUT=src/main/jniLibs',
'APP_BUILD_SCRIPT=src/main/jni/Android.mk',
'NDK_APPLICATION_MK=src/main/jni/Application.mk'
}
tasks.withType(JavaCompile) {
compileTask -> compileTask.dependsOn ndkBuild
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
ndkBuild {
path 'src/main/jni/Android.mk'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation project(':openCVLibrary320')
}
提前致谢!
答案 0 :(得分:1)
也许您可以尝试:
packagingOptions{
pickFirst 'xxxxx.so'
}