I added firebase analytics in my app just to try it out. I followed the steps in official guidelines.
Now I have decided against it. I have undone whatever I had done to add it. (Removed entries from project level and app level build.gradle; removed all usages from source code.)
But I am still getting logs like this when my app runs:
I/FirebaseInitProvider: FirebaseApp initialization successful
This leads me to believe that I haven't removed it completely. This is really a matter of concern for me now because my app has exceeded method count limit and I have had to enable multidex.
How can I completely remove firebase from my app?
Permanently deactivate collection If you need to deactivate Analytics collection permanently in a version of your app, set FIREBASE_ANALYTICS_COLLECTION_DEACTIVATED to YES (Boolean) in your app's Info.
Go to the Cloud Firestore section of the Firebase console. Click the Indexes tab. Hover over the index you want to delete and select Delete from the context menu. Confirm that you want to delete it by clicking Delete from the alert.
In addition to linking accounts, accounts may also be unlinked by identifying the ID of the authentication provider to be removed and passing it through to the unlink() method of the current user's Firebase User object.
If you want to completely remove the firebase, you can achieve it by reversing the setup steps.
-- UPDATE --
From https://stackoverflow.com/a/37945280/4758255 :
I would suggest you to exclude the firebase group using gradle in app module build.gradle
, you can add this in dependency:
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, simply apply a global exclude configuration (Remember that this should be outside any groovy function), like this :
configurations {
all*.exclude group: 'com.google.firebase', module: 'firebase-common'
}
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 do not get added automatically again) and removes all firebase libraries from generated code and intermediate output as well.
Compared to the previous answer this knocks off another 87,000 bytes from apk size.
Though I still do not understand why I should have to ADD more code to undo adding something. It's probably a bug in the build system.
@isnotmenow: Thanks a lot for pointing me in this direction.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With