【问题标题】:All firebase libraries must be either above or below 14.0.0所有 firebase 库必须高于或低于 14.0.0
【发布时间】:2018-09-24 20:35:47
【问题描述】:

我检查了我的 app build.gradle 文件,这些是其中唯一与 firebase 相关的行

/***
 * Firebase
 */
implementation 'com.google.firebase:firebase-core:15.0.0'
implementation 'com.google.firebase:firebase-messaging:15.0.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.1@aar') {
    transitive = true
}
implementation 'com.google.firebase:firebase-ads:15.0.0'

我没有任何使用 firebase 的库,所以我认为使用旧版本的库不会有问题。

问题是我无法使用新的 v15 版本的 firebase 构建 gradle、清理项目或重建项目,因为它不断抛出错误 All firebase libraries must be either above or below 14.0.0

【问题讨论】:

  • 你能告诉我们你的 build.gradle+ 你是否在文件底部添加了 apply plugin 行来启用 Gradle 插件?

标签: android firebase firebase-cloud-messaging firebase-analytics firebase-crash-reporting


【解决方案1】:

原来我忘记更改com.google.android.gms:play-services-ads 的版本号,将其切换为15.0.0 并且成功了。

这是一个由 Google 提供的博客,其中提供了更多信息。 Announcing new SDK versioning in Google Play services and Firebase

【讨论】:

  • 太棒了,没想到还有其他 play-services 插件依赖于匹配 firebase 插件的版本。
【解决方案2】:
apply plugin: 'com.google.gms.google-services'

把它放在这一行下面。

apply plugin: 'com.android.application'

它对我有用。

【讨论】:

  • 这没有任何意义,但它对我有用,谢谢!拯救了我的一天
  • 谢谢,也为我工作......但是,我必须问谷歌:为什么?
【解决方案3】:

我还没有在你的问题中找到问题 但如果你想要最新版本的 Firebys 办公室 这与版本 27.0.3 兼容

//Firebase
implementation 'com.google.firebase:firebase-database:11.8.0'
implementation 'com.google.firebase:firebase-storage:11.8.0'
implementation 'com.google.firebase:firebase-auth:11.8.0'
implementation 'com.firebaseui:firebase-ui-database:2.0.1'
implementation 'com.google.firebase:firebase-messaging:11.8.0'
implementation 'com.google.firebase:firebase-core:11.8.0'

【讨论】:

    【解决方案4】:

    从 App 级别的 gradle 中删除它

    implementation 'com.google.android.gms:play-services-maps:15.0.0'
    

    然后尝试这些版本

    compile 'com.google.firebase:firebase-core:11.8.0'
    compile 'com.google.firebase:firebase-messaging:11.8.0'
    compile 'com.google.firebase:firebase-database:11.8.0'
    compile 'com.google.firebase:firebase-auth:11.8.0'
    

    这个对我有用... tanx

    【讨论】:

      【解决方案5】:

      为我改变这项工作:

      implementation 'com.firebase:geofire-android:2.1.2'
      implementation 'com.google.android.gms:play-services:12.0.1'
      implementation 'com.google.firebase:firebase-core:12.0.1'
      implementation 'com.google.firebase:firebase-database:12.0.1'
      implementation 'com.google.firebase:firebase-messaging:12.0.1'
      implementation 'com.google.firebase:firebase-core:12.0.1'
      implementation 'com.google.firebase:firebase-auth:12.0.1'
      

      尝试找到高于 14.0.0 的任何内容,例如:

      implementation 'com.google.android.gms:play-services-location:15.0.0'
      

      并尝试将其更改为旧版本,例如

      implementation 'com.google.android.gms:play-services-location:12.0.1'
      

      【讨论】:

        【解决方案6】:

        例如改变 implementation 'com.google.android.gms:play-services-appindexing:9.8.0'implementation 'com.google.firebase:firebase-appindexing:15.0.1' ,因为这个建议出现在 build.gradle 的警告中。

        【讨论】:

          【解决方案7】:

          对我有用的是将com.google.android.gms:play-services-location:15.+ 更改为com.google.android.gms:play-services-location:11.6.2,使其与我的com.google.firebase:firebase-messaging:11.6.2 库版本相同。

          更改在文件 platform/android/project.properties 中。

          位置和推送通知库现在运行良好

          【讨论】:

            【解决方案8】:

            将所有 Firebase 库更改为相同版本。

            【讨论】:

              【解决方案9】:

              在更改 google 或 firebase 依赖版本时,请确保您也更新项目级 gradle 中的兼容版本。

              【讨论】:

                【解决方案10】:

                我有同样的问题,更改版本解决了它:

                compile 'com.google.android.gms:play-services-location:16.0.0'
                compile 'com.google.firebase:firebase-core:16.0.5'
                compile 'com.google.firebase:firebase-appindexing:16.0.2'
                compile 'com.google.android.gms:play-services-maps:16.0.1'
                compile 'com.google.android.gms:play-services-places:16.0.1'
                compile 'com.google.android.gms:play-services-location:16.0.0'
                compile 'com.google.firebase:firebase-auth:16.0.5'
                compile 'com.google.firebase:firebase-database:16.0.5'
                compile 'com.firebaseui:firebase-ui-database:1.0.1'
                compile 'com.google.firebase:firebase-storage:16.0.5'
                compile 'com.google.firebase:firebase-messaging:17.3.4'
                

                希望对你有帮助

                【讨论】:

                  猜你喜欢
                  • 1970-01-01
                  • 1970-01-01
                  • 1970-01-01
                  • 2023-04-11
                  • 1970-01-01
                  • 1970-01-01
                  • 2015-06-09
                  • 1970-01-01
                  • 2012-04-03
                  相关资源
                  最近更新 更多