Skip to main content

[Android] How can I track ANR?

Issue

I want to detect and monitor Application Not Responding (ANR) errors in my Android app, where the main UI thread is blocked for more than five seconds and the app becomes frozen or unresponsive.

Applies To

  • All SaaS Customers and Self-Hosted Users

  • Android SDK

  • Error Monitoring

  • Release Health

Resolution

Application Not Responding (ANR) tracking is enabled by default in recent Android SDK versions (6.13.0 and above). When the main UI thread is blocked for more than five seconds, the SDK reports an ANR error, and it appears as a Sentry issue in your Issues tab. To learn how detection works and how to disable it with the io.sentry.anr.enable manifest flag, see the Application Not Responding documentation.

If you have Release Health (sessions) enabled, Sentry also calculates a User-perceived ANR Rate and a Foreground ANR Rate from your ANR errors and user sessions. To view them:

  1. Go to the Projects page and click your Android project.

  2. Find the ANR Rate card in the Project Details section.

  3. Click View Issues to see the ANR issues for the selected timeframe and environment.

  4. Open the Display menu on the ANR rate graph to switch between the ANR Rate and Foreground ANR Rate views.

If your app runs on Apple platforms (iOS, tvOS, macOS), the equivalent feature is App Hangs, not ANR. For setup and behavior, see the App Hangs documentation, and to adjust the hang detection threshold, see How can I change the timeout for app hangs?.

Did this answer your question?