• <small id='rBlso'></small><noframes id='rBlso'>

      <bdo id='rBlso'></bdo><ul id='rBlso'></ul>

    1. <legend id='rBlso'><style id='rBlso'><dir id='rBlso'><q id='rBlso'></q></dir></style></legend>

      <tfoot id='rBlso'></tfoot>
    2. <i id='rBlso'><tr id='rBlso'><dt id='rBlso'><q id='rBlso'><span id='rBlso'><b id='rBlso'><form id='rBlso'><ins id='rBlso'></ins><ul id='rBlso'></ul><sub id='rBlso'></sub></form><legend id='rBlso'></legend><bdo id='rBlso'><pre id='rBlso'><center id='rBlso'></center></pre></bdo></b><th id='rBlso'></th></span></q></dt></tr></i><div id='rBlso'><tfoot id='rBlso'></tfoot><dl id='rBlso'><fieldset id='rBlso'></fieldset></dl></div>

      1. Ionic firebase 指定 google-services.json

        Ionic firebase specify google-services.json(Ionic firebase 指定 google-services.json)

          <bdo id='r6Zyf'></bdo><ul id='r6Zyf'></ul>
        • <tfoot id='r6Zyf'></tfoot>

                <tbody id='r6Zyf'></tbody>
            1. <legend id='r6Zyf'><style id='r6Zyf'><dir id='r6Zyf'><q id='r6Zyf'></q></dir></style></legend>
                <i id='r6Zyf'><tr id='r6Zyf'><dt id='r6Zyf'><q id='r6Zyf'><span id='r6Zyf'><b id='r6Zyf'><form id='r6Zyf'><ins id='r6Zyf'></ins><ul id='r6Zyf'></ul><sub id='r6Zyf'></sub></form><legend id='r6Zyf'></legend><bdo id='r6Zyf'><pre id='r6Zyf'><center id='r6Zyf'></center></pre></bdo></b><th id='r6Zyf'></th></span></q></dt></tr></i><div id='r6Zyf'><tfoot id='r6Zyf'></tfoot><dl id='r6Zyf'><fieldset id='r6Zyf'></fieldset></dl></div>

                  <small id='r6Zyf'></small><noframes id='r6Zyf'>

                • 本文介绍了Ionic firebase 指定 google-services.json的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个 ionic 3 项目,我想将 firebase 添加到项目中.

                  I have an ionic 3 project and I wanted to add firebase to the project.

                  我安装了 firebase cordova 插件并将我的 google-services.json 放在 resources/android 中,但在解析 google-services.json 时出现错误:找不到与包匹配的客户端名字[这里的名字]

                  I installed the firebase cordova plugin and placed my google-services.json in resources/android but I get an error while parsing google-services.json : No matching client found for package name [name here]

                  当我查看放入 resources/android 的 google-services.json 时,包名称是正确的,但是当我查看 platforms/android 时,文件是完全不同,包名是 com.github.cordova_plugin_firebase

                  When I look at my google-services.json that I put in resources/android the package name is correct but when I look in platforms/android the file is completely different and the package name is com.github.cordova_plugin_firebase

                  有人知道如何确保使用正确的 google-services.json 吗?

                  Anyone know how can make sure the correct google-services.json is used?

                  推荐答案

                  试试这个步骤.

                  1. 首先使用 ionic cordova platform remove android

                  将 google-services.json 文件复制到根目录(package.json/config.xml 文件所在的位置).

                  copy google-services.json file to the root directory (where package.json/config.xml file).

                  然后尝试使用 ionic cordova platform add android 添加 android 平台.然后检查自动复制的 android 文件夹 google-services.json 文件,如果没有,则将其复制到 android 文件夹.

                  then try to add android platoform using ionic cordova platform add android.then check your android folder google-services.json file copied automatically,if not then copy it to the android folder.

                  然后检查您的 build.gradle 文件以包含 google-services插件和 Google 的 Maven 存储库:

                  Then check your build.gradle fileto include the google-services plugin and the Google's Maven repository:

                  buildscript{
                     //add dependencies as per your google-service version
                   dependencies {
                       classpath 'com.google.gms:google-services:4.2.0' // google-services plugin 
                   }
                  
                   allprojects {
                     repositories {
                         google() // Google's Maven repository
                   }
                  }
                  

                • 然后,在您的模块 Gradle 文件 (app/build.gradle) 中,在文件底部添加 apply plugin 行以启用 Gradle 插件

                • Then, in your module Gradle file (app/build.gradle), add the apply plugin line at the bottom of the file to enable the Gradle plugin

                  dependencies {
                      implementation 'com.google.firebase:firebase-core:16.0.7'
                   }
                  
                  // ADD THIS AT THE BOTTOM
                  apply plugin: 'com.google.gms.google-services'
                  

                • 注意:如果您使用 codova-android >= 7,您现在必须添加

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

                  这篇关于Ionic firebase 指定 google-services.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Sqlite database not copied from asset folder Android(Sqlite 数据库未从资产文件夹 Android 复制)
                  SQLite Database Copy Appears Corrupted When Generated by Device and not Emulator(SQLite 数据库副本在由设备而不是模拟器生成时出现损坏)
                  Android file copy(安卓文件拷贝)
                  Android how to detect Copy event of Edittext in android(Android如何在android中检测Edittext的Copy事件)
                  Android copy image from gallery folder onto SD Card alternative folder(Android将图像从图库文件夹复制到SD卡替代文件夹)
                  Is there a tool to find unused resources in an Android project?(是否有工具可以在 Android 项目中查找未使用的资源?)

                  <small id='AnkU6'></small><noframes id='AnkU6'>

                      <tbody id='AnkU6'></tbody>
                      <bdo id='AnkU6'></bdo><ul id='AnkU6'></ul>
                        1. <tfoot id='AnkU6'></tfoot>

                        2. <i id='AnkU6'><tr id='AnkU6'><dt id='AnkU6'><q id='AnkU6'><span id='AnkU6'><b id='AnkU6'><form id='AnkU6'><ins id='AnkU6'></ins><ul id='AnkU6'></ul><sub id='AnkU6'></sub></form><legend id='AnkU6'></legend><bdo id='AnkU6'><pre id='AnkU6'><center id='AnkU6'></center></pre></bdo></b><th id='AnkU6'></th></span></q></dt></tr></i><div id='AnkU6'><tfoot id='AnkU6'></tfoot><dl id='AnkU6'><fieldset id='AnkU6'></fieldset></dl></div>
                          <legend id='AnkU6'><style id='AnkU6'><dir id='AnkU6'><q id='AnkU6'></q></dir></style></legend>