AndroidX中Glide包冲突问题

新建了一个测试项目,准备使用Glide测试一些东西,但是却报错。

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.0-runtime (androidx.core:core:1.3.0) 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.0-runtime (androidx.core:core:1.3.0) 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.0-runtime (androidx.core:core:1.3.0) 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.0-runtime (androidx.core:core:1.3.0) 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.0-runtime (androidx.core:core:1.3.0) 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.0-runtime (androidx.core:core:1.3.0) 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.0-runtime (androidx.core:core:1.3.0) 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.0-runtime (androidx.core:core:1.3.0) 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.0-runtime (androidx.core:core:1.3.0) 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.0-runtime (androidx.core:core:1.3.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)

* 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.

 根据日志看是引用冲突问题,用了排除依赖的方法依然不行。

进入Glide的Github地址:

https://codechina.csdn.net/mirrors/bumptech/glide?utm_source=csdn_github_accelerator

看到最新版本是12,所以就更新版本到4.12.0就可以了。


版权声明:本文为songzi1228原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。