【问题标题】:I have changed the Firebase name in my app but still the app loads the old firebase我已在我的应用中更改了 Firebase 名称,但该应用仍会加载旧的 Firebase
【发布时间】:2019-01-19 00:52:39
【问题描述】:

我将所有设置更改为我自己的设置。 firebase 设置是我自己的。

"firebase_url": "https://xxxxxxxxx.firebaseio.com",

我在 android studio 中重建应用程序,即 build apk。 将它上传到我的手机,当我尝试它时,它仍然在应用程序中有旧的 Firebase。 我现在不知道该怎么办,希望有人能帮助我。

更新:

它可以是包名中的东西吗? 这是我的名字。

root/app/build.gradle

applicationId: com.xxxxxxx.user.app

root/app/src/main/AndroidManifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.xxxxxxx.app">

Root/app/google-services.json

{
  "project_info": {
    "project_number": "xxxxxxxxxxxxxxxxxxx",
    "firebase_url": "https://xxxxxxx-user.firebaseio.com",
    "project_id": "xxxxxxx-user",
    "storage_bucket": "xxxxxxx-user.appspot.com"
  },
  "client": [
    {
      "client_info": {
        "mobilesdk_app_id": "xxxxxxxxxxxxxxxxxxxxxxxxxx",
        "android_client_info": {
          "package_name": "com.xxxxxx.user.app"
        }
      },

Firebase 控制台:

Project name : xxxxxxx-user
Project ID : xxxxxxx-user

root/app/src/main/java/com/xxxxxxx/user/app/Helper

package com.xxxxxxx.user.app.Helper;

【问题讨论】:

  • 您拥有的应用程序将根据您放置在根目录 (Root/app/google-services.json) 中的文件连接到 FireBase,而不管您计算机上的应用程序名称及其在 FireBase 上的名称。因此,请务必替换将应用程序链接到正确 Firebas 项目的文件。
  • 但这就是问题所在。它没有连接。我不能在firebase中添加任何东西。 .它连接到不在 google-services 中的另一个 firebase .. 我在项目中找不到链接..

标签: android firebase android-studio firebase-realtime-database


【解决方案1】:

确保在 firebase 中创建新的 google-services.json,或删除项目根文件夹中已有的那个。

从 Firebase 控制台:

  1. 只需登录控制台
  2. 选择应用连接到的项目
  3. 您将看到一个显示有关 Android 应用程序信息的框 连接到 Firebase 项目
  4. 点击android应用框右上角的3点按钮 并点击管理
  5. 向下滚动并单击高级旁边的箭头按钮 选项标题
  6. 会出现一个删除这个应用程序按钮,点击它就会出现 断开您的 Android 应用与 Firebase 项目的连接。

【讨论】:

  • 我已经这样做了,仍然有旧的 firebase 喜欢,不是我的。
  • 它不起作用,生成一个新的 google-service.json 并且它不起作用......
猜你喜欢
  • 2020-12-07
  • 1970-01-01
  • 1970-01-01
  • 2023-01-10
  • 1970-01-01
  • 1970-01-01
  • 2021-08-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多