11

I am facing issue while debugging our ANR's. After fixing few ANR's in the last releases suddenly facing the TOP ANR's not having any stack trace. enter image description here

Any idea what is the issue over here. My code having Native code also.

Abhishek Kumar
  • 236
  • 1
  • 10
  • 2
    I am facing the same issue.. Come on, Google! – Papps Jun 04 '21 at 20:56
  • 1
    Any luck with this? I have this exact same problem and on my top two ANR issues. – casolorz Jun 07 '21 at 18:58
  • 1
    Since Google isn't helping properly with ANRs, you can try out a handy tool named ANR-WatchDog https://github.com/SalomonBrys/ANR-WatchDog – Sabet Chowdhury Jun 14 '21 at 13:03
  • Thank you for that link, I would be a bit scared of using that on production without some serious testing by I will definitely test it even if just to see which parts of my app are taking longer than I would like. Thanks. – casolorz Jun 14 '21 at 19:15

1 Answers1

1

No update from the Google. But you can use github.com/SalomonBrys/ANR-WatchDog as mention by Sabet in the comment section. Very handy tool, easy to integrate and use. I used it with firebase crashlytics. It provide better logs/stacktrace then google.

How it works

The watchdog is a simple thread that does the following in a loop:

  1. Schedules a runnable to be run on the UI thread as soon as possible.
  2. Wait for 5 seconds. (5 seconds is the default, but it can be configured).
  3. See if the runnable has been run. If it has, go back to 1.
  4. If the runnable has not been run, which means that the UI thread has been blocked for at least 5 seconds, it raises an error with all running threads stack traces.
Abhishek Kumar
  • 236
  • 1
  • 10