More than one file was found with OS independent path 'lib/armeabi/libmyJNI.so'
More than one file was found with OS independent path 'lib/armeabi-v7a/libmyJNI.so'
More than one file was found with OS independent path 'lib/arm64-v8a/libmyJNI.so'
More than one file was found with OS independent path 'lib/x86/libmyJNI.so'
…
这个问题是由于有多项相同选项,所以选择首项即可,也可使用指定架构替换通配符。
在app下的build.gradle中加入以下代码:
android {
...
packagingOptions {
pickFirst 'lib/*/libmyJNI.so'
}
}
解释一下packagingOptions的几个选项:
doNotStrip "*/*/libyuv2.so"
不需要对应架构exclude 'META-INF/rxjava.properties'
排除pickFirst 'lib/*/libmyJNI.so'
选择首项