我将我的项目更新到最新的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.

当前回答

我只是在下载谷歌服务时遇到了问题。json从Firebase控制台。结果我不得不注销除Firebase账户外的所有谷歌账户。

其他回答

您必须进入Firebase控制台—>设置—>项目设置,然后会有下载最新配置文件的部分。下载谷歌服务。并放入app文件夹。这是我的工作。 链接: https://developers.google.com/identity/sign-in/android/start-integrating https://developers.google.com/android/guides/client-auth

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

对于从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.

步骤:

导航到你的项目文件夹,打开/app子文件夹。 在这里粘贴.json文件。 重新构建项目。

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

更新:

Goto

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