gpt4 book ai didi

android - Firebase 与 appcompat 不兼容

转载 作者:行者123 更新时间:2023-11-29 22:58:56 25 4
gpt4 key购买 nike

我刚刚更新了 gradle 依赖项,现在我遇到编译错误,我不知道如何管理。

这是我的 gradle 依赖项:

dependencies {
implementation "android.arch.work:work-runtime:1.0.1"
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-messaging:19.0.1'
implementation 'com.google.android.gms:play-services-plus:17.0.0'
implementation 'com.google.android.gms:play-services-places:17.0.0'


implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:support-v4:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}

Firebase 和 play-service 似乎与 appcompat 不兼容,但我不知道如何处理。

我得到的错误是:

Manifest merger failed : Attribute application@appComponentFactory value=(androidx.core.app.CoreComponentFactory) from [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86
is also present at [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91 value=(android.support.v4.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:5:5-19:19 to override.

添加'tools:replace="android:appComponentFactory"按照建议使事情变得更糟。

Appcompat 在工具提示中显示此消息: Dependencies using groupId com.android.support and androidx.* can not be combined but found IdeMavenCoordinates{myGroupId='com.android.support', myArtifactId='viewpager', myVersion='28.0.0', myPacking='aar', myClassifier='null'} and IdeMavenCoordinates{myGroupId='androidx.interpolator', myArtifactId='interpolator', myVersion='1.0.0', myPacking='aar', myClassifier='null'} incompatible dependencies less... (⌘F1)
Inspection info:There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion).

我需要有关如何修复 gradle 依赖项的建议。

最佳答案

您必须在 gradle.properties 文件中添加两行:

android.useAndroidX=true
android.enableJetifier=true

这两行解决了谷歌文件和其他第三方依赖项之间的冲突。

尝试升级所有当前的依赖项。

关于android - Firebase 与 appcompat 不兼容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57133422/

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