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

当前回答

如果你不再需要它了……

…\ build.gradle:

类路径的com.google.gms:谷歌服务:3.2.0

->

// classpath 'com.google.gms:google-services:3.2.0'

…\ app \ build.gradle:

应用插件:'com.google.gms.google-services'

->

// apply plugin: 'com.google.gms.google-services'

其他回答

在你的Android Studio中找到工具>Firebase,然后点击连接你的应用到Firebase。他们会帮你安排的。

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

我在尝试运行谷歌的Firebase分析示例应用程序时收到了这个错误:

先决条件:

下载https://github.com/firebase/quickstart-android 添加快速入门/分析到Android Studio

添加程序:

Go to https://firebase.google.com/ Click on "GO TO CONSOLE" Click on "Add Project" Project name: Enter: sample-app Click "Create Project" [Takes about 10 seconds or so...] Click "Continue" On the "Getting Started" page, click "Add Firebase to your Android app" Enter package name for the android app [The full package name appears at the top of the manifest: "com.google.firebase.quickstart.analytics"] Click on download google-services.json In file explorer, add google-services.json to the directory: "quickstart/analytics/app" [Warning: Do not rename the file, it must be: google-services.json] Run 'app' The sample app already contains the necessary Gradle file settings. When adding a new project do: Tools -> Firebase -> Analytics -> Add Event -> Connect App to Firebase. Adding a project via Android Studio ensures that all the Gradle Dependecies are setup.

删除程序:

访问https://firebase.google.com/ 点击“转到控制台” 设置—>项目设置—>删除此应用 设置—>业务群组设置—>删除业务群组 输入项目ID,按delete键

我多次添加和删除示例应用程序,没有任何明显的副作用。

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

添加google-service最简单的方法。json文件

在Android Studio中遵循以下步骤:

单击“工具> Firebase”,打开“助手”窗口。

单击以展开列出的功能之一(例如“分析”),然后单击“入门”教程以连接到Firebase并将必要的代码添加到应用程序中。