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/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的几个选项:

  1. doNotStrip "*/*/libyuv2.so" 不需要对应架构
  2. exclude 'META-INF/rxjava.properties' 排除
  3. pickFirst 'lib/*/libmyJNI.so' 选择首项
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。