I'd like to use this face recognition library in my Android project, and so I've added the library in my build.gradle. But when I build the project, it throws this error:
More than one file was found with OS independent path 'lib/armeabi-v7a/libopencv_java3.so'
I've tried to add this to my android {} in the app's build.gradle:
packagingOptions {
pickFirst 'lib/arm64-v8a/libopencv_java3.so'
}
and changed pickFirst with exclude, but it still returns the same error when rebuilding.
I have read that to use a native library, one needs to create a jni folder and put the native library code there, is this correct? If so, which files do I need to put there? As far as I'm concerned, the library is written in Java and it is a valid Android library, just that it uses native methods.
UPDATE: I've know added jni, libs and obj from library folder like so:
and specified
sourceSets.main {
jniLibs.srcDir 'src/main/libs'
jni.srcDirs = []
}
However there is still a similar error when building:
More than one file was found with OS independent path 'lib/arm64-v8a/libopencv_java3.so'
Any solution?
