Finding a crash which happens only in release.
Level 1: It’s always been a pain in the ass to find a crash in your app. Fixing it, Phew!
Level 2: Somehow you find the crash in your development environment and most of time you apply check for undefined and null.
Level 3: Next crash you find which is happening in a library which you are using and the crash is not in your code.
What you do: Stackoveflowing or Google, : Apply some hack or change the library.
Level 4: A crash which is happening in your release build not in debug build or in your development environment.
So you know that there is crash which is only happening in release build.
So you start looking into your code and you write console.log() to figure out where it is happening, but as this crash is not happening in develop environment and on simulators, I don’t think it will help much.
I suggest a technique which gonna sort this out.
- You need to have a logger account, I may suggest but not limited to
https://www.loggly.com/
2. You should be using the new feature in react which we call https://reactjs.org/docs/error-boundaries.html
However the problem are still there when we use above things, as Error Boundaries do not shows errors happening in
* Event handlers
*Asynchronous code
*Server side rendering
*Error thrown in error boundary itself
After doing that and getting your logs from logging service in released app, it will be easier for you to figure out where this crash is happening in released app on production.
Using the above methods you will likely uncover exiting crashes in your application that have been unnoticed before.
if that doesn’t help that means your components are not crashing, the crash is happening from a library and from an event handler.
Two very import piece of info it is providing: 1. Third party library 2. It is getting initiated from an event.
So you may narrow down your research to limited component event and third party libraries.
and if come so down, I hope you will be able to fix the crash.