More than one file was found with OS independent path ‘lib/armeabi-v7a/xxxx.so
程序员文章站
2024-03-25 08:31:16
...
出现的问题:
More than one file was found with OS independent path 'lib/armeabi-v7a/libopencv_java3.so'.
问题原因:
看网上说是同样的依赖路径存在两个,就是导入了两次同名的依赖
解决方法:
在app的build.gradle中添加以下代码即可解决问题
sourceSets {
main {
jniLibs.srcDirs = ['jniLibs']
}
}
注意:有两个build.gradle,我们是在app的build.gradle中的android节点下配置,而截图中右边的build.gradle是整个项目的。
踩坑注意:
如果在sourceSets.main中配置了jnilibs.srcDirs后,就不要在android节点下添加以下配置
(我的出现了错误 library "libopencv_java3.so" not found)
packagingOptions {
exclude 'lib/armeabi-v7a/libt_demo.so'
}
在搜索More than one file was found with OS independent path ‘lib/armeabi-v7a/xxxx.so这个问题的时候网上还有一种解决方法,
把这个配置删除掉或者将exclude换成pickFirst+错误路径就可以解决新出现的错误 library "libopencv_java3.so" not found(我是直接注释掉了)
每个人遇到的错误情况不一样,但是大致就这几种方法,可以都去尝试一下,希望能够对大家有帮助。
推荐阅读
-
More than one file was found with OS independent path ‘lib/armeabi-v7a/xxxx.so
-
More than one file was found with OS independent path 'lib/x86/libc++_shared.so'
-
More than one file was found with OS independent path 'lib/armeabi-v7a/libgnustl_shared.so'
-
More than one file was found with OS independent path 'assets/ap1.data'
-
AndroidStudio4.0版本More than one file was found with OS independent
-
Android:More than one file was found with OS independent path 'res/values/values.xml
-
Android studio 配置Javacv出现“More than one file was found with OS independent path”的解决办法
-
Android - jni - error:More than one file was found with OS independent path ‘lib/*so‘
-
Android问题集锦(十) - More than one file was found with OS independent path 'META-INF/DEPENDENCIES'
-
More than one file was found with OS independent path 'lib/armeabi-v7a/libgnustl_shared.so'