我将我的项目更新到最新的Play服务类路径“com.google.gms:google-services:1.5.0-beta2”。我也在我的app.gradle文件中使用最新版本的playservices:

compile 'com.google.android.gms:play-services-location:8.3.0'
compile 'com.google.android.gms:play-services-gcm:8.3.0'

然而,当我编译时,Gradle抛出异常如下

Error:Execution failed for task ':app:processDebugGoogleServices'. > File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it.

当前回答

对于从firebase codelabs教程第3步来到这里的人:请转到第4页。

Apparently, if google says You should now have the android-start project open in Android Studio. ,She means it,and not You should now have the android-start project open in Android Studio, without any build-errors . As the instruction says there, you have to get a configuration file from firebase. i.e , create a new project in your firebase acc with name 'friendly chat and in the next page , add its package name and SHA1 KEY. after downloading the json file,add it to your project>app folder, and Rebuild project.

其他回答

也面临过同样的问题…

在我的情况下,我已经拯救了

google-services.json

as

google_services.json

我尝试了上面提到的每一种解决方案,但都没有帮助…… 错误是你需要把“_”换成“-”(破折号)。

只是将文件重构到google-services。来自google_services的Json。Json工作很有魅力..

希望这能有所帮助!!

附注:我知道这听起来很傻,但这只对我有用……

您需要从开发人员的站点获取配置文件,并将其粘贴到项目的应用程序级目录中。

更新:

Goto

https://console.firebase.google.com/ 选择您的项目 在左侧菜单中,单击设置>项目设置 添加一个应用程序或下载谷歌服务。json文件在你的应用程序部分。

非常简单的 点击工具->Firebase->连接到Firebase,然后点击同步 这肯定会奏效。

如果您无法访问项目的Firebase,例如,您下载了一个示例源代码,那么您必须删除任何与Firebase相关的东西才能使项目运行。

在项目中搜索关键字

列表项 织物 重火力点 谷歌服务 crashlytics

从开发人员的站点转到配置文件,并将其粘贴到当前项目的应用程序级目录中。