记录一个解决依赖库包冲突的bug

2019-03-01  本文已影响0人  MissPSTime

1.报错:com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/gson/annotations/Expose.class

2.解决方法:因为是依赖库中的引用冲突了,所以我们需要忽略其中一个

3.compile files()

 compile() {

    exclude : , : }

4.注意事项:只能忽略下方的引用,而不能忽略jar包,否则会报错:

Error:(198, 0) Could not find method exclude() for arguments [{group=com.google.code.gson, module=gson}] on file collection of type org.gradle.api.internal.file.collections.DefaultConfigurableFileCollection.这个错误目前没有找到解决方法,所以建议使用3步骤中的方式

上一篇 下一篇

猜你喜欢

热点阅读