Google Firebase version conflict

今天本来在搞基于Firebase的一个项目,突然之间编译出错了,报了如下错误

Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 11.4.2.

很纳闷,之前跑的都是好好的,突然就不行了
build.gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
...

dependencies {
    ...
    implementation "com.google.firebase:firebase-core:15.0.0"
    implementation "com.google.firebase:firebase-firestore:15.0.0"
}

把firebase的版本号改为11.4.2之后,没有报错了,但是不理解为什么,后面找了一下,把apply plugin: 'com.google.gms.google-services'移到最底部就可以了

又在google上搜索了一下,发现应该是这个原因吧:

google-services plugin could not detect any version for com.google.android.gms or com.google.firebase, default version: 9.0.0 will be used. please apply google-services plugin at the bottom of the build file.

所以强迫症什么的还是得在google爸爸面前妥协。。

你可能感兴趣的:(Google Firebase version conflict)