More than one file was found with OS independent path 'META-INF/XXX'

在Android工程里面增加coap依赖库

implementation 'org.eclipse.californium:californium-core:3.5.0'

后出现如下错误

编译错误

依照官方的代码,我在我的module下增加了

    packagingOptions {
        pickFirst 'META-INF/INDEX.LIST'
        pickFirst 'META-INF/INDEX.LIST'
        pickFirst 'META-INF/io.netty.versions.properties'
        pickFirst 'META-INF/legal/**'
        exclude '**/*.jks'
    }

依然出现了前面的错误

后面查询资料(原文不知道去哪里了,抱歉原博主),得知原因是我的module是lib而不是app

你只需要在你的app下添加packagingOptions相关内容就OK了

你可能感兴趣的:(More than one file was found with OS independent path 'META-INF/XXX')