如何完全断开 Android 应用程序与 Firebase 的连接(在 Android studio 中)
How to completely disconnect an Android app from Firebase (in Android studio)
我想完全断开我的应用程序与 Firebase 的连接。这个问题已经被问过好几次了(例如 here)。大多数答案都集中在 Firebase 控制台 内 而不是 Android studio.
内 断开应用程序与 Firebase 的连接
在我的应用程序与 Firebase 控制台断开连接之后。每次我尝试将应用程序重新连接到另一个 Firebase 项目时,都会弹出一个错误气球,指出该应用程序已经是 Firebase 项目的一部分。我知道发生这种行为是因为旧 Firebase 项目中的一些文件仍然存在。我该如何摆脱它们?
您应该撤消 manual integration 中指示您执行的所有步骤。因此,从 build.gradle 中删除所有 Firebase 依赖项,从 build.gradle 底部删除 Google 服务插件,并删除 google-services.json 文件。
尝试关闭使用已连接应用程序包名称创建的Firebase 项目;尽管它不会同时删除,而是安排在以后删除。请勿 link 您的 android 应用程序与任何其他 firebase 应用程序一起使用,直到完全删除之前连接的应用程序。
试试这个,在项目级别,删除 google-services.json 文件
然后同步项目
尝试这些步骤从 Android Studio 项目中删除 Fire-base。
Delete google-services.json
file from the Project (Find the file by Project view)
Remove dependencies from Project-level build.gradle
(/build.gradle)
buildscript {
dependencies {
// Remove this line
classpath 'com.google.gms:google-services:4.2.0'
}
}
Remove all the Fire-base related dependencies from the project App-level build.gradle
(//build.gradle) file
dependencies {
// Remove this line
implementation 'com.google.firebase:firebase-core:17.0.0'
}
Remove the line below from the bottom of the App-level build.gradle
(//build.gradle) file
apply plugin: 'com.google.gms.google-services'
Restart Android Studio
执行以下操作(如果您想切换 Firebase 数据源):
在 Android Studio 中,转到工具>Firebase,选择任何选项,例如实时数据库
单击连接到 Firebase。
您将收到一条警告,提示该应用程序已连接到 Firebase。
点击确定。
Android Studio 将在浏览器上打开 Firebase 控制台。
选择您想要连接的 Firebase 应用程序。
完毕。
在主菜单上,select app ,select ,google-services.json' 然后右击然后删除
我想完全断开我的应用程序与 Firebase 的连接。这个问题已经被问过好几次了(例如 here)。大多数答案都集中在 Firebase 控制台 内 而不是 Android studio.
内 断开应用程序与 Firebase 的连接在我的应用程序与 Firebase 控制台断开连接之后。每次我尝试将应用程序重新连接到另一个 Firebase 项目时,都会弹出一个错误气球,指出该应用程序已经是 Firebase 项目的一部分。我知道发生这种行为是因为旧 Firebase 项目中的一些文件仍然存在。我该如何摆脱它们?
您应该撤消 manual integration 中指示您执行的所有步骤。因此,从 build.gradle 中删除所有 Firebase 依赖项,从 build.gradle 底部删除 Google 服务插件,并删除 google-services.json 文件。
尝试关闭使用已连接应用程序包名称创建的Firebase 项目;尽管它不会同时删除,而是安排在以后删除。请勿 link 您的 android 应用程序与任何其他 firebase 应用程序一起使用,直到完全删除之前连接的应用程序。
试试这个,在项目级别,删除 google-services.json 文件
然后同步项目
尝试这些步骤从 Android Studio 项目中删除 Fire-base。
Delete
google-services.json
file from the Project (Find the file by Project view)Remove dependencies from Project-level
build.gradle
(/build.gradle)
buildscript {
dependencies {
// Remove this line
classpath 'com.google.gms:google-services:4.2.0'
}
}
Remove all the Fire-base related dependencies from the project App-level
build.gradle
(//build.gradle) file
dependencies {
// Remove this line
implementation 'com.google.firebase:firebase-core:17.0.0'
}
Remove the line below from the bottom of the App-level
build.gradle
(//build.gradle) file
apply plugin: 'com.google.gms.google-services'
Restart Android Studio
执行以下操作(如果您想切换 Firebase 数据源): 在 Android Studio 中,转到工具>Firebase,选择任何选项,例如实时数据库 单击连接到 Firebase。 您将收到一条警告,提示该应用程序已连接到 Firebase。 点击确定。 Android Studio 将在浏览器上打开 Firebase 控制台。 选择您想要连接的 Firebase 应用程序。 完毕。
在主菜单上,select app ,select ,google-services.json' 然后右击然后删除