How to enable Firebase Crash Reporting - Android

后端 未结 6 1663
遥遥无期
遥遥无期 2020-12-11 01:27

I followed all the steps on the docs to use Firebase Crash Reporting in my Android app (I use Android Studio and everything is up-to-date).

I used their own code to t

相关标签:
6条回答
  • 2020-12-11 01:51

    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.

    0 讨论(0)
  • 2020-12-11 02:00

    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.

    0 讨论(0)
  • 2020-12-11 02:02

    You should allow some time to show up. Even though the documentation says the errors will show up within 5 minutes, it can take up to 15-20 minutes. Also, you have to change your old modules to AndroidX by migrating it if you use native development. Finally, make sure that all the tools and plugins are added in the appropriate Gradle files.

    0 讨论(0)
  • 2020-12-11 02:07

    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.

    0 讨论(0)
  • 2020-12-11 02:11

    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'
          }
        }
    
    0 讨论(0)
  • 2020-12-11 02:15

    The FirebaseCrash is deprecated. The FirebaseCrashlytics.getInstance() should be used instead:

    FirebaseCrashlytics.getInstance().log(message)
    FirebaseCrashlytics.getInstance().recordException(throwable)
    

    Source: https://firebase.google.com/docs/crashlytics/customize-crash-reports?platform=android#add-logs

    0 讨论(0)
提交回复
热议问题