Remove firebase analytics from the Android app completely.

I added Firebase analytics to my application to try it. I followed the instructions of the official guide.

Now I have decided against this. I canceled everything I did to add this. (Removed entries from the project level and the application level build.gradle; removed all uses from the source code.)

But I still get logs like this when my application is running:

I/FirebaseInitProvider: FirebaseApp initialization successful 

It makes me believe that I did not delete it completely. Now this is really troubling because my application has exceeded the limit on the number of methods, and I had to enable multidex.

How can I completely remove Firebase from my application?

+16
android android-studio firebase firebase-analytics
source share
4 answers

Adding

 configurations { all*.exclude group: 'com.google.firebase', module: 'firebase-core' all*.exclude group: 'com.google.firebase', module: 'firebase-iid' } 

removes all lines from app / app.iml containing firebase (and they are not automatically added automatically), and also removes all firebase libraries from the generated code and intermediate output.

Compared to the previous answer, this drops another 87,000 bytes of apk size.

Although I still don't understand why I need to add ADD more code in order to undo something. This is probably an error in the build system.

@isnotmenow: Thank you very much for pointing me in this direction.

+11
source share

If you want to completely remove firebase, you can achieve this by changing the configuration steps.

  • Remove classpath 'com.google.gms: google-services: 3.0.0 from your gradle project.
  • Remove compile 'com.google.firebase: firebase-core: 9.2.0' from your build.gradle application.
  • Remove the apply plugin: "com.google.gms.google-services" at the bottom of your build.gradle file.
  • Remove the FirebaseService code from your project.
  • Remove google-services.json from your project.
  • Remove the Google key from your manifest.
  • Remove google key from your resource.
  • Clear project.
  • Build a project.
  • Remove the installed application from the test device, and then install it again.

- UPDATE -

From fooobar.com/questions/557844 / ... :

I suggest you exclude the firebase group with gradle in the module build.gradle application, you can add this depending:

 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' } 

Or just apply the global exception configuration (remember that this should be outside of any groovy function), for example:

 configurations { all*.exclude group: 'com.google.firebase', module: 'firebase-common' } 
+18
source share

I had the same problem, I deleted the google_services.json file. Removed Firebase dependencies and, most importantly, in build.gradle (Project: GrowBuds), delete the following line

 apply plugin: 'com.google.gms.google-services' 
+1
source share

I also ran into this problem, and after too much effort I found a legal solution 1) Change the package name by changing the name of pacakage 1) Convert your studio from the project level to the Android level 2) Right-click on the Android level and select on compact medium 3) change the middle name of the package 4) again as the 3rd step change the name of the package 5) change the name of the package in the Gradle file 2) go to the firebasel console add the manullay project add the new package name pacakge add your sha1 key and continue 3) synchronize your Yahoo project, you sd Lali \

  • List item
0
source share

All Articles