Angular global exception handling

Hello Forum,

I have created an Android App using Ionic 5 and Capacitor, Google Crashlytics included.
The App shows a Splashscreen and loads a login page afterwards.
This works in Android Studio, on all USB-connected devices I have tested and on multiple devices via Google-Play-Installation.

A tester told me there are two phones not showing the login page but a black screen after the Splahscreen. I absolutly have no idea how to debug this from remote.
I already bought one of those phones the tester used - even on this one the App is working as it should.

I need to catch the Error that leads to the black screen on the device of that user wihtout havng access to that device. How can I do that?

I know how to send custom Logs to Crashlytics using this Plugin:


But this tool does not catch all errors within the app but is just manually triggered.
Is there any possibility of catching all errors in the App globally and send data to Crashlytics (or elsewhere)?

I have also tried using the Ionic Tool AppCenterCrashes. After installing this I have not been able to compile the app in Android Studio until I completely removed it from package.json again.

Has anyone of you any idea?

Thanks a lot for your help,
Frank

Which JS framework are you using - Angular, Vue, React, etc?

Angular provides ErrorHandler for global exception handling. I imagine you could implement that, and on error, send data to Crashlytics. More details here.

In general, if your app is crashing on startup, then review your startup code to narrow down the issue. What are the very first steps your app takes after showing the splash screen? Are you making external HTTP calls that could fail for a particular user? etc.

1 Like

Thanks for your answer, netkow.
I am using Angular, dont know why I forgot to mention that. The ErrorHandler seems like exactly what I was looking for, so I will give it a try. I just searched for Ionic and Capacitor tools, not Angular itself.

1 Like