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

在这里插入图片描述
解决方案:

sourceSets {
    main { jniLibs.srcDirs = ['libs']}
}

Android - jni - error:More than one file was found with OS independent path ‘lib/*so‘_第1张图片

你可能感兴趣的:(java,android,so)