# Firebase Crash Reporting
# How to report an error
Firebase Crash Reporting (opens new window) automatically generates reports for fatal errors (or uncaught exceptions).
You can create your custom report using:
FirebaseCrash.report(new 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 initialize**d com.google.firebase.crash.internal.zzg@3333d325 07–20 08:57:24.442 D/FirebaseApp: **Initialized class com.google.firebase.crash.FirebaseCrash.**
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");
# How to add Firebase Crash Reporting to your app
In order to add Firebase Crash Reporting to your app, perform the following steps:
buildscript {
// ...
dependencies {
// ...
classpath 'com.google.gms:google-services:3.0.0'
}
}
apply plugin: 'com.google.gms.google-services'
compile 'com.google.firebase:firebase-crash:10.2.1'
FirebaseCrash.report(new Exception("Non Fatal Error logging"));
All your fatal exceptions will be reported to your Firebase Console.
FirebaseCrash.log("Level 2 completed.");
For more information, please visit: