How to enable Firebase Crash Reporting - Android

别说谁变了你拦得住时间么 提交于 2019-11-29 09:18:11

Please note the following:

  • After adding the SDK you can try using:

    FirebaseCrash.report(new Exception("My first Android non-fatal error"));

  • Errors take up to 20 minutes to show up in the Crash Reporting console. Check back to see your report there.

  • (It may seem obvious but) make sure you have:INTERNET and ACCESS_NETWORK_STATE permission.

Crash reporting was not working for me too after correctly setting it up in my App. To fix this I visited my developer console, API Manager, and enabled the "Mobile Crash and Performance Reporting API". To find out exactly where you need to do this follow the steps on this page.

If you follow the steps in the link above, the logcat that has the text "E/FirebaseCrashSenderServiceImpl: Error sending crash report" gives you a URL to where you must go in the console to enable crash reporting.

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, Use 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.

I had the same issue. Turns out I was missing dependency in my project gradle file. Try adding this. It should help.

buildscript {
      repositories {
        jcenter()
        // ...
      }

      dependencies {
        // ...
        classpath 'com.google.firebase:firebase-plugins:1.0.5'
      }
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!