androidfirebasereact-nativecrashlyticsgoogle-fabric

react-native-firebase crashlytics not showing up on firebase dashboard


I am using firebase crashlytics. I am causing a crash by doing

firebase.crashlytics().crash()

and I am not seeing the crash report on the firebase dashboard. The crash is working because on android i get this screen enter image description here

and on ios the app freezes and i get brought to this page on xcode

enter image description here

But on the crashlytics dashboard on firebase the crashes are not showing up.

Is there any reason why the crashes are not showing up on crashlytics dashboard? I am using react-native-firebase. I know i installed it correctly because I tried causing the crashes natively on android with java and I am able to see the crash on crashlytics.


Solution

  • TL;DR: run react-native run-android --variant=release for Crashlytics to begin working properly, assuming you've set everything up correctly (which it certainly appears you have since firebase.crashlytics().crash() is crashing your application.)

    Please note - in order for react-native run-android --variant=release to function properly, you will have needed to configure your APK for release builds according to the directions here: https://facebook.github.io/react-native/docs/signed-apk-android

    I've never been happier to see my crash free users rating decrease :)

    Let me know if you have any questions! Setting up signing can be a little confusing, so let me know if you have any questions.


    This is a very frustrating issue, but fortunately, I've found the solution and I'm in exactly the same boat you are.

    See that big red screen? That's React Native's way of telling you, during development, that you've made some kind of mistake. What isn't immediately obvious is that this red screen prevents errors from making it through to our error reporting tools. Running your app in release mode will prevent React Native from showing that red screen, and your error reporting tools will be able to report crashes.


    As Gian has pointed out in another answer to this question, it appears that firebase.crashlytics().crash() is not functioning properly. However, this isn't quite true. Whenever you are operating in debug mode (anytime you can see the red screen, you're in what I'm calling debug mode), Crashlytics and other crash reporting tools cannot catch Native Exceptions, but they can catch Javascript exceptions. Once you run the application in release mode as I’ve described above, Crashlyitcs will be able to catch Native Exceptions. If you look into Crashlytics.crash(), it’s actually an crash intentionally written in Java. In order for Crashlytics to actually ‘hear’ that the application is crashed due to a Native Exception, you have to be running in release mode, not debug mode. Sorry for beating the dead horse down here, but I’ve been looking into this issue all morning and felt it pertinent to share this information to others suffering the same fate as I was.