When I build the android project, it show \"Duplicate class\" exception,
1 exception was raised by workers: java.lang.RuntimeException:
java.lang.RuntimeEx
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"
}