如果没有 google-services.json,Google 服务插件将无法运行 [英] Google Services Plugin cannot function without google-services.json

查看:35
本文介绍了如果没有 google-services.json,Google 服务插件将无法运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文件 google-services.json 丢失.Google 服务插件无法运行

File google-services.json is missing. The Google Services Plugin cannot function

我收到此错误代码,因为我从我的项目中删除了 google-services.json 文件.现在解决这个问题的显而易见的方法是再次包含它,但我有理由将其删除.

I get this error code since I deleted my google-services.json file from my project. Now the obvious way to solve this issue would be to include it again, but I had a reason to remove it.

"注意:如果您在以下情况下仅启用了 Google 登录您生成了配置文件,您可以跳过这一步.Google Sign-In 不需要将配置文件包含在您的项目中——生成文件执行必要的配置步骤."- 这是官方说明文档,并且由于我只启用了 Google 登录,我没有看到此错误消息的原因.有没有人也遇到过这个问题并解决了这个问题,因为我认为我正确地实现了一切.

"Note: If you enabled only Google Sign-In when you generated the configuration file, you can skip this step. Google Sign-In does not require the configuration file to be included in your project—generating the file performs the neecessary configuration steps." - this is the official note in the documentation and since I only enabled Google Sign-In I don't see a reason for this error message. Does anyone have had this problem too and a solve to it because I think that I implemented everything correctly.

注意:它使用项目中包含的文件.

Note: It works with the file in the project included.

澄清一下,我的应用程序运行良好,我没有任何问题,但我想知道为什么我不能删除 google-services.json 文件,即使我应该可以这样做没问题!

To clarify, my application works completely fine and I have no problems, but I wondered why I cannot remove the google-services.json file even though I should be able to do it with no problem!

推荐答案

当您添加 apply plugin: 'com.google.gms.google-services' 在您的应用级 build 中时.gradle 它从 google-services.json 文件解析配置信息.

When you add apply plugin: 'com.google.gms.google-services' inside your app-level build.gradle it parses configuration information from the google-services.json file.

您删除了 google-services.json 文件,这就是它无法解析的原因
因此也从您的应用级 build.gradle 谁触发了解析以使其再次工作.

You removed google-services.json file, that's why it is not able to parse
So remove the below line too from your app-level build.gradle who triggered parsing to make it work again.

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

这篇关于如果没有 google-services.json,Google 服务插件将无法运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆