More than one file was found with OS independent path

墨蓝 2023-02-17 05:14 85阅读 0赞

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中加入以下代码:

  1. android {
  2. ...
  3. packagingOptions {
  4. pickFirst 'lib/*/libmyJNI.so'
  5. }
  6. }

解释一下packagingOptions的几个选项:

  1. doNotStrip "*/*/libyuv2.so" 不需要对应架构
  2. exclude 'META-INF/rxjava.properties' 排除
  3. pickFirst 'lib/*/libmyJNI.so' 选择首项

发表评论

表情:
评论列表 (有 0 条评论,85人围观)

还没有评论,来说两句吧...

相关阅读