Search code examples
androidfirebasefirebase-crash-reporting

How to disable Firebase Crash Reporting when the app is running on debug?


I have successfully implemented Firebase Crash Reporting, but I need to disable the service when the app is running undo the 'debug' Build Variant, in order to avoid non-real crashes in the console during the development.

The official documentation doesn't say anything about this.


Solution

  • UPDATED: With Google Play Services / Firebase 11+ you could now disable crash reporting at runtime. FirebaseCrash.setCrashCollectionEnabled() (Thanks @Tyler Carberry)

    OLD ANSWER:

    There is no official support for this, as far as the community has been able to surmise. The best way I would suggest to do this is, set up multiple Firebase apps in your dashboard, one for each build type, and set up multiple google_services.json files directing to each different app depending on the build variant.