guava-19.0和google-collections-1.0 的 ImmutableSet 类冲突

guava-19.0 google-collections-1.0 都有 ImmutableSet 类,包路径也一致,前者有 copyOf(Collection)?

一、应用报错:

二、解决办法

configurations.all {

  exclude module: 'logback-core'

  exclude module: 'logback-classic'

  exclude module: 'google-collections'

}

三、重启应用

比较前后生成的依赖关系

gradlew dependencies > dependsx.txt

没有google-collections-1.0.jar

问题解决!

原文地址:https://www.cnblogs.com/lexiaofei/p/7171783.html