根据这个 SO线程,我知道存在版本冲突,但是在谷歌的新版本之后问题仍然存在。
错误:任务':app:processDebugGoogleServices'的执行失败。请通过更新google-services插件的版本来修复版本冲突(有关最新版本的信息,请访问https://bintray.com/android/android-tools/com.google.gms.google-services/)或将com.google.android.gms的版本更新为10.0.1。
我的build.gradle(模块: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'
现在需要做哪些改变?
发布于 2019-06-03 16:05:09
谷歌播放服务要求其所有依赖项具有相同的版本。但是,如果你看看你的依赖:
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'
有一个版本不同。
可以通过将版本更改为(在本例中)来解决11.0.4
。
这适用于Firebase和Google Play服务 - 两者都必须具有相互匹配的匹配版本。如果Firebase依赖项10.0.1
与Google Play服务相关性11.0.4
相同,则会发生相同的错误。
请注意,在某些情况下,可能存在具有不同版本库的库(例如,当您在应用程序中使用依赖项时库x
使用)play-services-games:10.0.111.0.4
这个答案不包括版本个别的新版本。更新com.google.gms:google-services:4.1.0
并检查mvnrepository(或其他一些maven / gradle artifact搜索工具)以查找最新版本。
发布于 2019-06-03 16:54:42
当抛出相同的错误时
apply plugin: 'com.google.gms.google-services'
未添加到模块build.gradle
文件的底部。
https://stackoverflow.com/questions/-100006898
复制相似问题