How do I find dependencies causing class duplication?

后端 未结 2 1927
执念已碎
执念已碎 2020-12-01 20:05

When I build the android project, it show \"Duplicate class\" exception,

1 exception was raised by workers:   java.lang.RuntimeException:
java.lang.RuntimeEx         


        
2条回答
  •  一整个雨季
    2020-12-01 20:14

    You need to exclude the arch Jar. First of all check where the duplicate comes from. You can see it if you print your dependency tree with a gradle task:

    ./gradlew -q dependencies app:dependencies --configuration compile
    

    Then exclude the older arch Jar like you did for glide but with the correct exclude, for example:

    implementation ('android.arch.persistence.room:runtime:1.0.0-alpha1') {
        exclude group: "android.arch.core"
    }
    

提交回复
热议问题