我将Firebase库更新到最新版本,但我无法同步gradle,这会导致以下错误:
错误:任务':app:processProductionDebugGoogleServices'的执行失败 . 请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息,请访问https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为11.0.2 .
正如它所述,我也将gms版本更新为11.0.2 . 这是我的傻瓜:
compileSdkVersion 25
buildToolsVersion "26.0.0"
//other gradle config
String googleSupportVersion = '25.3.1'
String googlePlayServicesVersion = '11.0.2'
compile "com.google.firebase:firebase-core:$googlePlayServicesVersion"
compile "com.google.firebase:firebase-auth:$googlePlayServicesVersion"
compile "com.android.support:appcompat-v7:$googleSupportVersion"
compile "com.android.support:support-v4:$googleSupportVersion"
compile "com.google.android.gms:play-services:$googlePlayServicesVersion"
compile "com.android.support:design:$googleSupportVersion"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
apply plugin: 'com.google.gms.google-services'
和
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.google.gms:google-services:3.1.0'
}
}
我该如何解决这个问题?
2 回答
将您的Google服务插件更新为3.1.0
试试这
def googlePlayServicesVersion = '11.0.2'
而不是String googlePlayServicesVersion = '11.0.2'