Android Firebase Crash Reporting

How to add Firebase Crash Reporting to your app

In order to add Firebase Crash Reporting to your app, perform the following steps:

  • Create an app on the Firebase Console here.

  • Copy the google-services.json file from your project into your in app/ directory.

  • Add the following rules to your root-level build.gradle file in order to include the google-services plugin:

    buildscript {
        // ...
        dependencies {
            // ...
            classpath ''
  • In your module Gradle file, add the apply plugin line at the bottom of the file to enable the Gradle plugin:

    apply plugin: ''
  • Add the dependency for Crash Reporting to your app-level build.gradle file:

    compile ''
  • You can then fire a custom exception from your application by using the following line: Exception("Non Fatal Error logging"));

    All your fatal exceptions will be reported to your Firebase Console.

  • If you want to add custom logs to a console, you can use the following code:

    FirebaseCrash.log("Level 2 completed.");

For more information, please visit:

How to report an error

Firebase Crash Reporting automatically generates reports for fatal errors (or uncaught exceptions).

You can create your custom report using: Exception("My first Android non-fatal error"));

You can check in the log when FirebaseCrash initialized the module:

07–20 08:57:24.442 D/FirebaseCrashApiImpl: FirebaseCrash reporting API initialized 07–20 08:57:24.442 I/FirebaseCrash: FirebaseCrash reporting initialized [email protected] 07–20 08:57:24.442 D/FirebaseApp: Initialized class

And then when it sent the exception:

07–20 08:57:47.052 D/FirebaseCrashApiImpl: throwable java.lang.Exception: My first Android non-fatal error 07–20 08:58:18.822 D/FirebaseCrashSenderServiceImpl: Response code: 200 07–20 08:58:18.822 D/FirebaseCrashSenderServiceImpl: Report sent

You can add custom logs to your report with

FirebaseCrash.log("Activity created");