How Do I Find Dependencies Causing Class Duplication?
When I build the android project, it show 'Duplicate class' exception, 1 exception was raised by workers: java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class
Solution 1:
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"
}
Solution 2:
You can use search everywhere dialog(Dialog that opens on pressing shift twice).
Simply copy class name and paste it in search dialog and it will show results in drop down. You can browse result and check for duplicate entries, Complete path of class will be displayed next to class name so you can find relative libraries and can safely exclude it from anyone of the library.
Post a Comment for "How Do I Find Dependencies Causing Class Duplication?"