gpt4 book ai didi

android - android.support.v4.media.MediaBrowserCompat $ CallbackHandler错误的原因

转载 作者:行者123 更新时间:2023-12-03 05:05:43 28 4
gpt4 key购买 nike

有一个源需要更新,但显示错误:

Program type already present: android.support.v4.media.MediaBrowserCompat$CallbackHandler

gradle.properties文件包括:
android.useAndroidX = true android.enableJetifier = false
app.gradle :
compileSdkVersion 29 minSdkVersion 19 targetSdkVersion 29
def component_version = '27.1.1'
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
//noinspection GradleCompatible
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:appcompat-v7:' + component_version
implementation 'com.android.support:design:' + component_version
implementation 'com.android.support:recyclerview-v7:' + component_version
implementation 'com.android.support:cardview-v7:' + component_version
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
// FCM
implementation 'com.google.firebase:firebase-messaging:20.1.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
// Material Dialog
implementation 'com.afollestad.material-dialogs:commons:0.9.6.0'
// Glide
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'com.github.bumptech.glide:okhttp-integration:1.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.0.0'
implementation 'jp.wasabeef:glide-transformations:2.0.1'
// Yoyo Animation
implementation 'com.daimajia.easing:library:2.1@aar'
implementation 'com.daimajia.androidanimations:library:2.3@aar'
// Abring SDK
implementation 'com.github.msddev:abring-sdk-android:v0.4'
// Infinite Scroll
implementation 'com.github.pwittchen:infinitescroll:0.0.1'
// retrofit
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation('com.squareup.retrofit2:retrofit:2.1.0') {
// exclude Retrofit’s OkHttp dependency module and define your own module import
exclude module: 'okhttp'
}
implementation 'com.squareup.okhttp3:logging-interceptor:3.11.0'
implementation 'com.squareup.okhttp3:okhttp:3.11.0'
// JW player
implementation 'com.longtailvideo.jwplayer:jwplayer-core:+'
implementation 'com.longtailvideo.jwplayer:jwplayer-common:+'
implementation project(':mediapicker')
}

最佳答案

根据您在问题中包含的内容,您正在尝试将AndroidX库添加到您的项目中。

无论如何,从多个依赖项中引用了较旧的支持库android.support.v4.media.MediaBrowserCompat。这就是您所看到的错误的含义。

要解决此问题,您应该运行gradlew app:dependencies来检索所有库的列表,并查看哪个库正在引用该库。

找到问题后,可以通过以下方式将库从依赖项中排除:

implementation ('library_name') {
exclude module: 'android.support.v4.media.MediaBrowserCompat'
}

我也将引用 documentation迁移到AndroidX,因为不再支持较早的支持库。

关于android - android.support.v4.media.MediaBrowserCompat $ CallbackHandler错误的原因,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59342958/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com