谷歌服务插件无法检测到com.google.android.gms或com.google.firebase的任何版本,将使用默认版本9.0.0。

7

我正在将 Firebase 集成到我的现有项目中,使用了这些库

   compile 'com.google.firebase:firebase-auth:9.0.2'
compile 'com.google.firebase:firebase-database:9.0.2'
compile 'com.google.android.gms:play-services:9.0.2'

依赖项

    dependencies {
    classpath 'com.android.tools.build:gradle:2.1.2'
    classpath 'com.google.gms:google-services:3.0.0'
    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

我遇到了以下错误:
Error:Execution failed for task ':app:processDebugGoogleServices'.

请通过更新google-services插件的版本(最新版本信息可在https://bintray.com/android/android-tools/com.google.gms.google-services/获取),或将com.google.android.gms的版本更新至9.0.0,解决版本冲突问题。

不明白发生了什么?

这些是我的Play Services版本 enter image description here


你在哪个文件中添加了依赖项-classpath?它应该在根目录下的“build.gradle”文件中。 另外,请查看gradle版本。我使用的是2.13。 - Manuel Schmitzberger
依赖项-classpath在正确的文件中,因为我已经运行这个项目8个月了。每当我们决定转移到Firebase并更改palysevices版本时,这些问题开始出现。 - Lokesh Tiwari
你在gradle.build中添加了"apply plugin: 'com.google.gms.google-services'"吗?我使用了这个教程 - Manuel Schmitzberger
是的,我已经添加了 apply plugin: 'com.google.gms.google-services'。 - Lokesh Tiwari
2个回答

7
我已经在 build.gradle(Module: app)中添加了最后一行代码:
 apply plugin: 'com.google.gms.google-services'

它开始工作了,我不知道背后的概念是什么?
但它正在工作。


3
谢谢。我曾将它放在顶部,从GCM迁移并且花费了2个小时努力研究为什么它不能正常工作。我感到非常困惑。 - Alexander Talavari

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接