How to fix Android ANR (Application Not Responding) errors

What causes Android apps to freeze and show "isn't responding", how to find ANRs in Play Console and traces, and practical fixes to keep the main thread free.

By the UK Technology Hub teamPublished 4 minute read

The short answer

An ANR (Application Not Responding) happens when an Android app's main thread is blocked too long, for example around five seconds without responding to input. Common causes are disk or network operations on the main thread, heavy computations, slow broadcast receivers, lock contention and blocking calls during startup. Find ANRs in Play Console's Android vitals, read the stack traces and move blocking work to background threads.

When an Android app freezes, users see a dialog saying the app isn't responding, with options to wait or close it. ANRs frustrate users and, if frequent, can affect your app's visibility on Google Play, which uses Android vitals as quality signals.

What triggers an ANR

The main thread, also called the UI thread, handles drawing and user input. If it's blocked:

  • Input events aren't handled within about five seconds.
  • A broadcast receiver doesn't finish in time.
  • A service doesn't start or a foreground service doesn't call startForeground in time.

Then Android may report an ANR.

Step 1: Find your ANRs

  • Google Play Console Android vitals shows ANR rates, affected devices and Android versions, with stack traces. Google Play has bad behaviour thresholds for ANR and crash rates; staying below them is important for visibility.
  • Crash and performance tools can capture ANRs with context.
  • Locally, ANR traces can be collected from devices during testing.

Step 2: Read the stack trace

Look at what the main thread was doing when the ANR occurred. Common patterns:

  • Waiting on a network or disk operation.
  • Waiting for a lock held by another thread.
  • Running a long loop or heavy computation.
  • Inflating complex layouts.
  • Waiting on inter-process communication.

Common causes and fixes

Disk and database work on the main thread

Reading files, querying databases or writing preferences synchronously blocks the UI.

Fix: use background threads or Kotlin coroutines with appropriate dispatchers, and libraries that perform I/O asynchronously.

Network calls on the main thread

Android blocks network calls on the main thread by default, but blocking waits on network results still cause ANRs.

Fix: make calls asynchronous and update the UI when results arrive.

Heavy computation

Parsing large data, image processing or complex calculations on the main thread.

Fix: move to background threads; process data in smaller chunks.

Slow startup

Initialising many SDKs or loading data in Application or the first Activity's creation.

Fix: defer non-essential initialisation, use lazy loading and show the first screen quickly. Our guide to app performance optimisation covers start-up speed.

Broadcast receivers

Doing long work in a broadcast receiver's onReceive method.

Fix: hand work off to WorkManager or a background task quickly.

Locks and synchronisation

The main thread waiting for a lock held by a background thread.

Fix: avoid sharing locks between the main thread and long-running background work; redesign data access.

Complex layouts

Deep layout hierarchies and expensive drawing slow rendering.

Fix: simplify layouts, use efficient lists and avoid unnecessary work in drawing code.

Step 3: Use developer tools

  • StrictMode flags disk and network access on the main thread during development.
  • Android Studio Profiler shows CPU usage and thread activity.
  • System tracing reveals what the main thread is waiting on.

Step 4: Test on lower-end devices

ANRs often affect older or budget devices first. Test on representative hardware with real data volumes.

Prevention

  • Treat the main thread as for UI only.
  • Use structured concurrency with coroutines.
  • Add performance checks to testing.
  • Monitor Android vitals after each release.
  • Use staged rollouts to catch problems early.

On iOS too?

iOS has a similar concept, where the system terminates apps that block the main thread too long. Our guide to fixing iOS crashes on launch covers that side.

Third-party SDKs and ANRs

SDKs for analytics, ads or crash reporting can block the main thread during initialisation or callbacks. Check ANR traces for SDK code, update SDKs to their latest versions and initialise non-essential ones lazily or off the main thread.

Measuring improvement

After releasing fixes, compare ANR rates in Android vitals by app version. Use staged rollouts so you can confirm improvement before reaching all users.

Share findings with the team

Document causes and fixes for past ANRs, so developers recognise risky patterns in code reviews and avoid repeating them.

How we help

Our mobile app development team diagnoses and fixes ANRs and performance issues. Our app development service builds responsive architectures from the start, and our maintenance and support plans include Android vitals monitoring.

Frequently asked questions

What does ANR mean on Android?

Application Not Responding: the app's main thread was blocked too long, so the system shows a dialog.

Do ANRs affect Google Play rankings?

Google Play uses Android vitals, including ANR rates, as quality signals, so high rates can affect visibility.

How do I find ANRs in my app?

Check Android vitals in Google Play Console, use performance tools and enable StrictMode during development.

This guide is general information, not legal, tax or financial advice, and details such as prices, features and rules can change. Product and company names mentioned are trademarks of their respective owners and are used only to identify those products; UK Technology Hub is not affiliated with or endorsed by them.

Related guides

How to fix the WordPress white screen of death

A calm, step-by-step guide to diagnosing and fixing a blank white WordPress page, from recovery mode and debug logs to plugins, themes and memory limits.

All bug fixes & troubleshooting guides