根据this SO线程,我知道存在版本冲突,但在Google新版本发布后问题仍然存在 .
错误:任务':app:processDebugGoogleServices'的执行失败 . 请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息,请访问https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为10.0.1 .
我的 build.gradle(Module: app)
....
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:26.+'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-messaging:10.0.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
What changes are required now?
12 回答
我想你改变了
当抛出相同的错误时
未添加到模块
build.gradle
文件的底部 .您必须只为所有3个库使用一个版本
或者仅对3个库使用10.0.1
请更改项目级
build.gradle
文件,您必须在其中更改google-services
或build.gradle
路径的依赖项类路径 .谷歌播放服务要求其所有依赖项具有相同的版本 . 但是,如果你看看你的依赖:
有一个版本不同 .
它可以通过将版本更改为(在这种情况下)
11.0.4
来解决 .这适用于Firebase和Google Play服务 - 两者都必须具有相互匹配的匹配版本 . 如果Firebase依赖项为
10.0.1
且Google Play服务依赖项为11.0.4
,则会发生相同的错误 .请注意,在某些情况下,可能存在具有不同版本库的库(例如,库
x
使用play-services-games:10.0.1
,而您在应用中使用11.0.4
作为依赖项)编辑
这个答案不包括版本个别的新版本 . 更新
com.google.gms:google-services:4.1.0
并检查mvnrepository(或其他一些maven / gradle工件搜索工具)以查找最新版本 .为了正确安装fire base,所有版本的fire base compiles必须在同一个版本中
这是正确的方法 .
同
你必须使用:
这解决了我的问题
最初,firebase数据库指向11.8.0 . 将所有相关的jar更改为11.0.4后,此问题在SDK级别得到解决 . 编译'com.google.firebase:firebase-database:11.0.4'compile'com.google.firebase:firebase-messaging:11.0.4'
正如消息所说:#2948561_
并复制最新版本的号码 . 我的不到3.3.1 . 然后在项目的build.gradle put / change dependencies节点中:
然后我同步了项目并且出错了
所有谷歌服务应该是相同的版本,每 versions 尝试 matching .
Correct one is :
Incorrect Config is :
重要更新
步骤(1):更新com.google.gms:google-services
步骤(2):更新Firebase依赖项最新版本
Firebase依赖版本可以是单独的 .
步骤(3):更新Play服务依赖项最新版本
播放服务版本也可以有单独的版本 .
Still having issue? 您可以通过阅读 this answer 来检查哪个依赖项发生冲突 .
安装或更新Google Play服务 . 其次,请检查您的“com.google.gms:google-services:3.0.0”版本 . 检查,如果仍然不能正常工作,请升级到3.1.0