文件google-services.json丢失.没有Ionic 3,Google Services插件将无法运行 [英] File google-services.json is missing. The Google Services Plugin cannot function without it ionic 3

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

问题描述

我正在使用FCM进行推送通知,我总是收到此错误消息

I am using FCM for push notification I always get this error message

缺少文件google-services.json.Google服务插件 没有离子3就无法运行

"File google-services.json is missing. The Google Services Plugin cannot function without it ionic 3"

在电话上,我已将google-services.json放在每个文件夹上,但没有任何作用

on phone I have placed my google-services.json on every folder and nothings working

推荐答案

下载google-services.json所需的全部拳头:

Fist of all you need to download google-services.json:

  1. 登录Firebase并打开您的项目.
  2. 单击设置"图标,然后选择项目设置".
  3. 在您的应用"卡中,从列表中选择您需要配置文件的应用的程序包名称.
  4. 点击google-services.json.

( =" https://support.google.com/firebase/answer/7015592 )

好,现在您必须安装cordova-support-google-services

Ok now you have to install cordova-support-google-services:

cordova plugin add cordova-support-google-services --save

然后,您必须将google-services.json放入项目的根目录(在同一级别的www文件夹外部),然后resource-file标记会将其复制到platform/android/app/

Then, you have to put the google-services.json in the root of your project (outside www folder, at the same level), and then the resource-file tag will copy it to platforms/android/app/

接下来,放入config.xml

Next, put in the config.xml

<platform name="android">
    <resource-file src="google-services.json" target="app/google-services.json" />
 ... 
 </platform>

注意:如果您使用版本7以下的cordova-android,请改为指定:

Note: if you use cordova-android below version 7 specify instead:

target ="google-services.json"

target="google-services.json"

现在再次尝试构建!

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

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