Android开发中遇到的编译问题-Execution failed for task ':app:checkDebugDuplicateClasses'.
发布网友
发布时间:2022-12-26 23:48
我来回答
共1个回答
热心网友
时间:2023-10-17 17:58
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 moles 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 moles 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 moles 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 moles 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 moles 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 moles 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.ResultReceiver found in moles 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.ResultReceiver$1 found in moles 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.ResultReceiver$MyResultReceiver found in moles 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.ResultReceiver$MyRunnable found in moles 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)
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
gradle.properties配置文件中,添加以下配置
# 表示使用AndroidX相关依赖
android.useAndroidX=true
# 表示将第三方库迁移到androidx
android.enableJetifier=true