如果出现了这个错误,确保以下两行代码同时出现在gradle.properties文件中
android.useAndroidX=true
android.enableJetifier=true
完整报错信息
Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.8.0-runtime (androidx.core:core:1.8.0) and support-compat-25.1.1-runtime (com.android.support:support-compat:25.1.1)
Duplicate class android.support.v4.app.INotificationSideChannelStubfoundinmodulescore−1.8.0−runtime(androidx.core:core:1.8.0)andsupport−compat−25.1.1−runtime(com.android.support:support−compat:25.1.1)Duplicateclassandroid.support.v4.app.INotificationSideChannelStubProxyfoundinmodulescore−1.8.0−runtime(androidx.core:core:1.8.0)andsupport−compat−25.1.1−runtime(com.android.support:support−compat:25.1.1)Duplicateclassandroid.support.v4.os.IResultReceiverfoundinmodulescore−1.8.0−runtime(androidx.core:core:1.8.0)andsupport−compat−25.1.1−runtime(com.android.support:support−compat:25.1.1)Duplicateclassandroid.support.v4.os.IResultReceiverStub found in modules core-1.8.0-runtime (androidx.core:core:1.8.0) and support-compat-25.1.1-runtime (com.android.support:support-compat:25.1.1)
Duplicate class android.support.v4.os.IResultReceiverStubProxy found in modules core-1.8.0-runtime (androidx.core:core:1.8.0) and support-compat-25.1.1-runtime (com.android.support:support-compat:25.1.1)
Duplicate class android.support.v4.os.ResultReceiver found in modules core-1.8.0-runtime (androidx.core:core:1.8.0) and support-compat-25.1.1-runtime (com.android.support:support-compat:25.1.1)
Duplicate class android.support.v4.os.ResultReceiver1foundinmodulescore−1.8.0−runtime(androidx.core:core:1.8.0)andsupport−compat−25.1.1−runtime(com.android.support:support−compat:25.1.1)Duplicateclassandroid.support.v4.os.ResultReceiverMyResultReceiver found in modules core-1.8.0-runtime (androidx.core:core:1.8.0) and support-compat-25.1.1-runtime (com.android.support:support-compat:25.1.1)
Duplicate class android.support.v4.os.ResultReceiver$MyRunnable found in modules core-1.8.0-runtime (androidx.core:core:1.8.0) and support-compat-25.1.1-runtime (com.android.support:support-compat:25.1.1)
Go to the documentation to learn how to Fix dependency resolution errors.