首页 > 解决方案 > 修复依赖解析错误 - 重复类错误

问题描述

 Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.5.0-runtime (androidx.core:core:1.5.0) and support-v4-23.4.0-runtime (com.android.support:support-v4:23.4.0)
    
    Go to the documentation to learn how to Fix dependency resolution errors.**strong text**

在构建中遇到此错误将运行应用程序

通过添加此依赖项....

    implementation 'com.thebluealliance:spectrum:0.7.1'
    implementation 'com.karumi:dexter:6.2.3'
    implementation 'com.github.QuadFlask:colorpicker:0.0.15' 

标签: javaandroidandroid-studioandroid-layouterror-handling

解决方案


请注意,一些 .jar 库与本地已经可用的依赖项捆绑在一起。因此,通过删除新添加的库之一可以解决问题...查找不附带已存在依赖项的库,或者您可以删除依赖项部分中的所有内容并仅添加库,同步项目。并一一添加其他依赖..


推荐阅读