沖突問題
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
說明
其實(shí)在出錯的同時也有這么斷錯誤:
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:
工具已經(jīng)提示我們怎么處理了。工程已經(jīng)配置了androidx,但又配置了support 的庫,運(yùn)行的時候可能會發(fā)生錯誤。請僅使用androidx的依賴或者在gradle.properties中添加android.enableJetifier=true將support庫轉(zhuǎn)換為androidx的依賴。文章來源:http://www.zghlxwxcb.cn/news/detail-618744.html
其次,個人在使用過程中,遇見了1.5 / 1.7的沖突,只有INotificationSideChannel和os.ResultReceiver兩個類沖突。若不是可以配置android.enableJetifier=true將其轉(zhuǎn)換,各種依賴查詢,各種exclude要死人的。文章來源地址http://www.zghlxwxcb.cn/news/detail-618744.html
到了這里,關(guān)于Duplicate class android.support.v4.app.INotificationSideChannel found in modules core-1.5.0-runtime的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!