天天看点

Android - jni - error:More than one file was found with OS independent path ‘lib/*so‘

编译JNI项目时,遇到了这样的错误:

More than one file was found with OS independent path 'lib/x86_64/libopencv_java4.so'. 
If you are using jniLibs and CMake IMPORTED targets, see https://developer.android.com/studio/preview/features#automatic_packaging_of_prebuilt_dependencies_used_by_cmake
           
Android - jni - error:More than one file was found with OS independent path ‘lib/*so‘

解决方案:

sourceSets {
    main { jniLibs.srcDirs = ['libs']}
}
           
Android - jni - error:More than one file was found with OS independent path ‘lib/*so‘