How to completely disconnect an Android app from Firebase (in Android studio)

Taslim Oseni picture Taslim Oseni · Jul 27, 2018 · Viewed 16.3k times · Source

I want to completely disconnect my app from Firebase. This question has been asked several times (e.g here). Most of the answers focus on disconnecting an app from Firebase within the Firebase console and not within Android studio.

After disconnecting my app from the Firebase console. Everytime I try to reconnect the app to another Firebase project, an error balloon pops up stating that the app is already part of a Firebase project. I know this behaviour occurs because some files from the old Firebase project are still present. How do I get rid of them?

Answer

Md. Rejaul Karim picture Md. Rejaul Karim · Jul 25, 2019

Try these steps to remove Fire-base from Android Studio project.

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