简体   繁体   English

找不到Google-services.json

[英]Google-services.json not found

I am facing this error 我面临这个错误

Error:Execution failed for task ':app:processDebugGoogleServices'. 错误:任务':app:processDebugGoogleServices'的执行失败。

File google-services.json is missing. 文件google-services.json丢失。 The Google Services Plugin cannot function without it. 没有它,Google Services插件将无法运行。 Searched Location: C:\\Users\\Kartik\\AndroidStudioProjects\\barcode\\app\\src\\debug\\google- services.json C:\\Users\\Kartik\\AndroidStudioProjects\\barcode\\app\\google-services.json 搜索的位置:C:\\ Users \\ Kartik \\ AndroidStudioProjects \\ barcode \\ app \\ src \\ debug \\ google- services.json C:\\ Users \\ Kartik \\ AndroidStudioProjects \\ barcode \\ app \\ google-services.json

I have added this path in build.gradle(project:barcode) 我已经在build.gradle(project:barcode)中添加了此路径

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

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

and added this in build.gradle(Module:app) 并将其添加到build.gradle(Module:app)中

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

I have also added the google-services.json file in project->app folder but then also it is giving the same error. 我还已经在project-> app文件夹中添加了google-services.json文件,但是它也给出了相同的错误。

i faced the same problem before . 我以前也遇到过同样的问题。 check the json file name and make sure that there is no additional spaces 检查json文件名,并确保没有其他空格

First of all please make sure that you have followed documentation for firebase and not google developers guidelines and alspo generated Google-services.json for firebase project that is running in your firebase-console, you can see all your running projects in your dashboard in firebase 首先,请确保您遵循的是Firebase的文档,而不是Google开发人员指南,并且alspo为在Firebase控制台中运行的firebase项目生成了Google-services.json,您可以在firebase的仪表板上查看所有正在运行的项目

Make sure you have correct json file, this problem is describe here . 确保您具有正确的json文件,此问题在此处描述。

You can follow these steps also as per firebase documentaion . 您也可以按照Firebase文档执行以下步骤。

still if you are all correct and getting errors make sure you have updated play services version in your SDK and also put this line in your app module build.gradle file, to make sure that multidex is unable. 如果您都是正确的并且遇到错误,请确保您已更新SDK中的播放服务版本,并将此行放入应用程序模块的 build.gradle文件中,以确保multidex无法使用。 Hope you will make something out of it. 希望你能从中受益。

defaultConfig {
    multiDexEnabled true
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM