Suspiciously short list of threads when recording ANRError as Crashlytics non-fatal exception
See original GitHub issueHi!
I integrated ANR-WatchDog to a Unity game using custom implementation of UnityPlayerActivity.
At first I released a game with the default behaviour of the ANR-WatchDog.
My app crashed due to unhandled ANRError and Firebase Crashlytics recorded something around 40 threads at this moment including UnityMain
thread and others. I used setReportMainThreadOnly()
because Crashlytics collects all threads by itself on fatal errors.
Then I turned this crash to a non-fatal using this code:
@Override protected void onCreate(Bundle savedInstanceState)
{
ANRWatchDog watchDog = new ANRWatchDog();
watchDog.setANRListener(new ANRWatchDog.ANRListener() {
@Override
public void onAppNotResponding(ANRError error) {
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance();
crashlytics.recordException(error);
}
});
watchDog.start();
super.onCreate(savedInstanceState);
}
This code records ANRError
as a non-fatal exception and Crashlytics attaches stack traces contained in ANRError
. That is why you do not see setReportMainThreadOnly()
here any more. But now crash reports a very short, containing only 8-10 threads. What is strange there were no UnityMain
thread while this non-fatal was triggered in the middle of a gameplay.
Please help, any ideas on how to get full list of stack traces attached?
Issue Analytics
- State:
- Created 2 years ago
- Comments:7
Top GitHub Comments
Yeah, ANR triggers only when
main
thread is blocked and Unity runs onUnity-Main
thread which is notmain
)) To emulate an ANR you can use code:Just call
AndroidShowStopper.Stop();
somewhere.How to integrate ANR-WatchDog to a Unity game using custom implementation of UnityPlayerActivity?