[as 报错]More than one file was found with OS independent path

Execution failed for task ':app:transformNativeLibsWithMergeJniLibsForDebug'.

More than one file was found with OS independent path 'lib/arm64-v8a/libc++_shared.so'

原因是引入了两个三方库,用到了.so,本地也用了一个串口的动态 .so

从报错来看,是重复引入了的感觉,但是我确定没有重复引入,但是不知道为什么出这个错误了。

网上找了很久,记录下解决办法,希望帮到需要的人。

[as 报错]More than one file was found with OS independent path_第1张图片
image.png
[as 报错]More than one file was found with OS independent path_第2张图片
image.png

最后的解决办法是 参照这个

android {

......

packagingOptions {

    pickFirst 'lib/arm64-v8a/libc++_shared.so'

    pickFirst 'lib/x86/libc++_shared.so'

    pickFirst 'lib/armeabi-v7a/libc++_shared.so'

}

}

所有报错误的 .so都选择第一个

你可能感兴趣的:([as 报错]More than one file was found with OS independent path)