Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 487
Tenzin Choklang Avatar asked Jan 31 '19 15:01

Tenzin Choklang


4 Answers

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.

like image 158
stack_overflow_user Avatar answered Nov 14 '22 21:11

stack_overflow_user


In iOS you need to unlink the app from Xcode so that it doesn't freeze when a crash occurs.

  1. Build the App.
  2. Stop the project in Xcode without terminating the simulator or device.
  3. Then you can crash without Xcode freezing.
  4. Reopen the app so that Firebase can send the crash report.

For more details on this, see here in the Firebase documentation.

like image 28
Lucas Garcez Avatar answered Nov 14 '22 21:11

Lucas Garcez


It will definitely help you

  1. Go to Edit Scheme
  2. Run -> Info
  3. Change the Build Configuration to release.
  4. Now run the App

    And crash your app manually. Now you can check on your crashlytics dashboard

Try this as well

  1. Launch your simulator/iPhone
  2. Press stop
  3. Launch your app and force a crash
  4. Relaunch the app from simulator/iPhone
  5. See the crash report in the crashlytics dashboard.
like image 2
vendeeshwaran Chandran Avatar answered Nov 14 '22 20:11

vendeeshwaran Chandran


firebase.crashlytics().crash() its not working properly.

I purposely made a bug to simulate a crash when i tap a button and that crash was caught and shown in the Crashlytics Dashboard inmediately.

Ej: I work with React Native so i changed a this.props.etc... to this.state.etc... to create an "undefined is not a function exception".

Hope it helps!

like image 1
Gian Pigatto Avatar answered Nov 14 '22 21:11

Gian Pigatto