【问题标题】:Google-services.json not found未找到 Google-services.json
【发布时间】:2016-07-07 17:41:56
【问题描述】:

我遇到了这个错误

错误:任务 ':app:processDebugGoogleServices' 执行失败。

文件 google-services.json 丢失。 Google 服务插件不能 没有它的功能。 搜索位置: C:\Users\Kartik\AndroidStudioProjects\barcode\app\src\debug\google- 服务.json C:\Users\Kartik\AndroidStudioProjects\barcode\app\google-services.json

我在 build.gradle(project:barcode) 中添加了这个路径

classpath 'com.android.tools.build:gradle:2.1.2'

classpath 'com.google.gms:google-services:3.0.0'

并将其添加到 build.gradle(Module:app)

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

我还在 project->app 文件夹中添加了 google-services.json 文件,但它也给出了同样的错误。

【问题讨论】:

  • 只是清理项目并尝试重建它并告诉发生了什么
  • 现在也面临同样的错误。

标签: android firebase


【解决方案1】:

我之前也遇到过同样的问题。 检查json文件名,确保没有多余的空格

【讨论】:

  • 是的,json 文件的名称不正确。我的错误:p
  • 所以,祝你好运,编码愉快:D
【解决方案2】:

首先,请确保您已遵循 firebase 文档而不是 google 开发人员指南,并且还为在您的 firebase-console 中运行的 firebase 项目生成了 Google-services.json,您可以在您的Firebase 中的仪表板

确保你有正确的json文件,这个问题描述here

您也可以按照firebase documentaion 执行这些步骤。

如果您都正确并遇到错误,请确保您已更新 SDK 中的 play services 版本,并将此行放入您的 app 模块 build.gradle 文件, 以确保 multidex 无法使用。希望你能从中有所收获。

defaultConfig {
    multiDexEnabled true
}

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-01-05
    • 2019-11-27
    • 2016-03-19
    • 2016-10-04
    • 2021-06-11
    • 2018-05-13
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多