Execution failed for task ':app:checkDebugDuplicateClasses'解决办法

A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable

  > Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-24.2.0-runtime (com.android.support:support-compat:24.2.0)

    Duplicate class android.support.v4.app.INotificationSideChannel$Stub found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-24.2.0-runtime (com.android.support:support-compat:24.2.0)

    Duplicate class android.support.v4.app.INotificationSideChannel$Stub$Proxy found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-24.2.0-runtime (com.android.support:support-compat:24.2.0)

    Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-24.2.0-runtime (com.android.support:support-compat:24.2.0)

    Duplicate class android.support.v4.os.IResultReceiver$Stub found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-24.2.0-runtime (com.android.support:support-compat:24.2.0)

    Duplicate class android.support.v4.os.IResultReceiver$Stub$Proxy found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-24.2.0-runtime (com.android.support:support-compat:24.2.0)



解决方法

gradle.properties配置文件中,添加以下配置

# 表示使用AndroidX相关依赖

android.useAndroidX=true

# 表示将第三方库迁移到androidx

android.enableJetifier=true

posted @ 2023-01-15 22:36  it世界库  阅读(3378)  评论(0编辑  收藏  举报