【问题标题】:Android studio Firebase dependency is not compatible with appcompatAndroid Studio Firebase 依赖与 appcompat 不兼容
【发布时间】:2018-05-10 13:04:32
【问题描述】:

我正在尝试使用appcompat-v7:27.0.0 将firebase-auth:15.0.0 依赖项添加到我的项目中,但这会导致警告“混合版本可能导致运行时崩溃”。 我还尝试添加 firebase-auth:15.1.0 的新更新依赖项,但它会导致同样的问题。

这是我的依赖块

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.google.firebase:firebase-auth:15.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'
}

【问题讨论】:

标签: android firebase firebaseui


【解决方案1】:

只要您使用在较低版本上运行的库,您就无法升级到版本 27.1.0。在您的情况下,您只需“放弃”并选择版本 26.1.0(最低公分母)。将所有库升级到 27.1.0 后,您可以升级到版本 27.1.0。

请尝试

implementation 'com.android.support:appcompat-v7:26.1.0'

【讨论】:

    【解决方案2】:

    试试这个

    implementation('com.google.android.gms:play-services-ads:15.0.1') {
        exclude group: "com.android.support"
    }
    

    【讨论】:

    • 虽然没有帮助我......但我在implementation 'com.google.firebase:firebase-ads:15.0.1'看到同样的错误
    【解决方案3】:

    此视频https://youtu.be/Vjy_uv10t30的错误已在此处修复

    或者

    添加这个//noinspection GradleCompatible

    之前

    implementation 'com.android.support:appcompat-v7:28.0.0'

    并同步。

    就是这样。

    【讨论】:

    • 请不要只发布链接。始终总结最重要的部分,以便您的答案在链接目标不再可用的情况下也很有用。
    猜你喜欢
    • 1970-01-01
    • 2017-03-01
    • 1970-01-01
    • 2016-07-22
    • 1970-01-01
    • 2021-09-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多