【问题标题】:Firebase and updating the version of the google-services pluginFirebase 和更新 google-services 插件的版本
【发布时间】:2018-07-14 11:15:46
【问题描述】:

当我尝试“将项目与 Gradle 文件同步”时,“build.gradle 文件(模块:app)”中出现了两个错误。该文件的副本如下。有问题的两条线是“依赖”的第一个和第四个实现,分别是:

  • 实现 'com.android.support:appcompat-v7:28.0.0-alpha3'

  • 实施 'com.google.firebase:firebase-auth:11.6.0'

我尝试与 Gradle 文件同步后,出现以下错误消息:

请通过更新版本来修复版本冲突 google-services 插件(有关最新版本的信息是 可在 https://bintray.com/android/android-tools/com.google.gms.google-services/) 或将 com.google.android.gms 的版本更新为 11.6.0。

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:28.0.0-alpha3'
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:support-annotations:28.0.0-alpha3'
    implementation 'com.google.firebase:firebase-auth:11.6.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.google.android.gms:play-services-maps:15.0.1'
    }

apply plugin: 'com.google.gms.google-services'

我搜索了这方面的信息,似乎问题出在版本控制上:但我承认我不知道哪个版本发生了变化,以及如何变化。

【问题讨论】:

    标签: android firebase android-studio plugins


    【解决方案1】:

    要解决这个问题,请更改以下代码行:

    implementation 'com.google.firebase:firebase-auth:11.6.0'
    

    implementation 'com.google.firebase:firebase-auth:16.0.2'
    implementation 'com.google.firebase:firebase-core:16.0.1'
    

    也请不要忘记添加:

    classpath 'com.google.gms:google-services:4.0.1'
    

    到您的 build.gradle 文件。请参阅here 了解更多信息。

    【讨论】:

    • 是的,我今天早上试过了,效果很好。重点是……那是我第一次写的……我不明白怎么做,但现在程序完全可以工作了……谢谢
    【解决方案2】:

    @Alex Mamo:我认为 28.0.0-alpha3 和最新版本的 Firebase 之间存在一些冲突。我尝试将 v16.0.2 用于 firebase,但它不起作用。

    【讨论】:

      猜你喜欢
      • 2020-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-11-06
      相关资源
      最近更新 更多