![](/img/trans.png)
[英]How to completely disconnect an Android app from Firebase (in Android studio)
[英]Remove firebase analytics from android app completely
我在我的應用程序中添加了 firebase 分析只是為了嘗試一下。 我遵循了官方指南中的步驟。
現在我決定反對它。 我已經撤消了我為添加它所做的一切。 (從項目級別和應用級別 build.gradle 中刪除條目;從源代碼中刪除所有用法。)
但是當我的應用程序運行時,我仍然收到這樣的日志:
I/FirebaseInitProvider: FirebaseApp initialization successful
這讓我相信我還沒有完全刪除它。 現在這對我來說確實是一個問題,因為我的應用程序已超出方法計數限制,我不得不啟用 multidex。
如何從我的應用程序中完全刪除 firebase?
如果你想完全移除 firebase,你可以通過顛倒設置步驟來實現。
-- 更新 --
從https://stackoverflow.com/a/37945280/4758255 :
我建議您在 app module build.gradle
使用 gradle 排除 firebase 組,您可以將其添加為依賴項:
compile('com.google.android.gms:play-services-ads:9.0.2') {
exclude group: 'com.google.firebase', module: 'firebase-common'
}
compile('com.google.android.gms:play-services-gcm:9.0.2') {
exclude group: 'com.google.firebase', module: 'firebase-common'
}
或者,只需應用全局排除配置(請記住,這應該在任何常規功能之外),如下所示:
configurations {
all*.exclude group: 'com.google.firebase', module: 'firebase-common'
}
添加
configurations {
all*.exclude group: 'com.google.firebase', module: 'firebase-core'
all*.exclude group: 'com.google.firebase', module: 'firebase-iid'
}
從 app/app.iml 中刪除所有包含 firebase 的行(並且它們不會再次自動添加)並從生成的代碼和中間輸出中刪除所有 firebase 庫。
與之前的答案相比,這從 apk 大小中又減少了 87,000 個字節。
雖然我仍然不明白為什么我必須添加更多代碼來撤消添加的東西。 這可能是構建系統中的錯誤。
@isnotmenow:非常感謝您為我指出這個方向。
我遇到了同樣的問題,我刪除了google_services.json
文件。 刪除了 firebase 依賴項,最重要的是在 build.gradle(項目:GrowBuds)中刪除以下行
apply plugin: 'com.google.gms.google-services'
我也面臨這個問題,經過太多努力,我找到了一個合法的解決方案 1)更改包名稱更改包名稱的方法 1)將您的工作室從項目級別轉換為 android 級別 2)右鍵單擊 android 級別並單擊在 Compact middle pacakage 3)更改包的中間名 4)再次像第 3 步一樣更改包的姓氏 5)更改 gradle 文件中的包名稱 2)轉到 firebasel 控制台添加項目 manullay 添加您的新包名稱 添加您的 sha1鍵並繼續 3)同步你已經完成的項目 yahoo \\
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.