Duplicate class android.support.v4.app.INotificationSideChannel found in modules

遇到以下问题

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-27.1.1-runtime (com.android.support:support-compat:27.1.1)
     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-27.1.1-runtime (com.android.support:support-compat:27.1.1)
     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-27.1.1-runtime (com.android.support:support-compat:27.1.1)
     Duplicate class android.support.v4.os.IResultReceiver found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
     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-27.1.1-runtime (com.android.support:support-compat:27.1.1)
     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-27.1.1-runtime (com.android.support:support-compat:27.1.1)
     Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
     Duplicate class android.support.v4.os.ResultReceiver$1 found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
     Duplicate class android.support.v4.os.ResultReceiver$MyResultReceiver found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
     Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.3.1-runtime (androidx.core:core:1.3.1) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

解决方法是gradle.properties中添加以下配置,选择AndroidX作为支持库

android.useAndroidX=true
android.enableJetifier=true

你可能感兴趣的:(Duplicate class android.support.v4.app.INotificationSideChannel found in modules)