冲突问题
androidx和support类冲突,具体如下:
Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.5.0-runtime (androidx.core:core:1.5.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.5.0-runtime (androidx.core:core:1.5.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.5.0-runtime (androidx.core:core:1.5.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.5.0-runtime (androidx.core:core:1.5.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.5.0-runtime (androidx.core:core:1.5.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.5.0-runtime (androidx.core:core:1.5.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.5.0-runtime (androidx.core:core:1.5.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.5.0-runtime (androidx.core:core:1.5.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.5.0-runtime (androidx.core:core:1.5.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.5.0-runtime (androidx.core:core:1.5.0) and support-compat-27.1.1-runtime (com.android.support:support-compat:27.1.1)
Go to the documentation to learn how to Fix dependency resolution errors.
解决办法
在工程中 gradle.properties 中加入配置:android.enableJetifier=true
说明
其实在出错的同时也有这么断错误:
AGPBI: {“kind”:“warning”,“text”:“Your project has set
android.useAndroidX=true
, but configuration:player:debugRuntimeClasspath
still contains legacy support libraries, which may cause runtime issues.\nThis behavior will not be allowed in Android Gradle plugin 8.0.\nPlease use only AndroidX dependencies or setandroid.enableJetifier=true
in thegradle.properties
file to migrate your project to AndroidX (see https://developer.android.com/jetpack/androidx/migrate for more info).\nThe following legacy support libraries are detected:\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.github.bumptech.glide:gifdecoder:4.9.0 -> com.android.support:support-annotations:27.1.1\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1 -> com.android.support:support-compat:27.1.1\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1 -> com.android.support:support-compat:27.1.1 -> android.arch.lifecycle:runtime:1.1.0\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1 -> android.arch.lifecycle:livedata-core:1.1.0 -> android.arch.lifecycle:common:1.1.0\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1 -> android.arch.lifecycle:livedata-core:1.1.0 -> android.arch.core:common:1.1.0\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1 -> com.android.support:support-core-ui:27.1.1\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1 -> com.android.support:support-core-utils:27.1.1\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1 -> android.arch.lifecycle:livedata-core:1.1.0\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1 -> android.arch.lifecycle:livedata-core:1.1.0 -> android.arch.core:runtime:1.1.0\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:support-fragment:27.1.1 -> android.arch.lifecycle:viewmodel:1.1.0\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:animated-vector-drawable:27.1.1\n:player:debugRuntimeClasspath -> project :listplayer -> com.github.bumptech.glide:glide:4.9.0 -> com.android.support:animated-vector-drawable:27.1.1 -> com.android.support:support-vector-drawable:27.1.1”,“sources”:[{}]}
Your project has set
android.useAndroidX=true
, but configuration:player:debugRuntimeClasspath
still contains legacy support libraries, which may cause runtime issues.
This behavior will not be allowed in Android Gradle plugin 8.0.
Please use only AndroidX dependencies or setandroid.enableJetifier=true
in thegradle.properties
file to migrate your project to AndroidX (see https://developer.android.com/jetpack/androidx/migrate for more info).
The following legacy support libraries are detected:
工具已经提示我们怎么处理了。工程已经配置了androidx,但又配置了support 的库,运行的时候可能会发生错误。请仅使用androidx的依赖或者在gradle.properties中添加android.enableJetifier=true将support库转换为androidx的依赖。文章来源:https://www.toymoban.com/news/detail-618744.html
其次,个人在使用过程中,遇见了1.5 / 1.7的冲突,只有INotificationSideChannel和os.ResultReceiver两个类冲突。若不是可以配置android.enableJetifier=true将其转换,各种依赖查询,各种exclude要死人的。文章来源地址https://www.toymoban.com/news/detail-618744.html
到了这里,关于Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.5.0-runtime的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!