Add following code: In Project-level build.gradle (/build.gradle):
buildscript { dependencies { // Add this line classpath 'com.google.gms:google-services:3.0.0' } } In App-level build.gradle (//build.gradle):
// Add to the bottom of the file apply plugin: 'com.google.gms.google-services' //Add following in In App-level build.gradle compile 'com.google.firebase:firebase-crash:9.0.0' Now sync your project, checkUse following code in your activity to throw exception:
FirebaseCrash.report(new Exception("App Name : My first Android non-fatal error")); check android crash reporting tutorial using firebase for complete guidance.