Eelipse项目到Studio上的错误信息
先看错误信息
Cause 1: java.util.concurrent.ExecutionException: java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-v4-23.4.0-runtime.jar (com.android.support:support-v4:23.4.0)
Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.1.0-runtime.jar (androidx.core:core:1.1.0) and support-v4-23.4.0-runtime.jar (com.android.support:support-v4:23.4.0)

产生这种错误是androidx和v包冲突,或者是重复了,删掉即可,解决办法:
①: 在dradle-wrapper.properties中添加:
android.useAndroidX=true
android.enableJetifier=true

②:删除已有的依赖:
将项目切换成Project视图:查看.idea文件夹–>libraries文件夹–>

查看你添加的依赖:

studio显示你已经添加了,你又添加,就冲突了;删掉就好了,多个中间加逗号隔开就好:
configurations {
// all*.exclude module: 'MultiImageSelector' //去除重复依赖库
}

网友评论