# ANR: Application Not Responding (Input dispatching timed out)

**Code:** `ANR` · **Category:** Android · **Seen on:** Android

The main thread was blocked for about 5 seconds (input) or a broadcast/service took too long, so Android showed “App isn’t responding”.

## Meaning

Disk/network/database work on the main thread, lock contention, heavy layout or deadlocks cause ANRs. Play Console’s Android vitals and traces.txt show the main-thread stack.

## Common causes

- I/O, database or network on the main thread
- Long computations/JSON parsing on main
- Deadlock or waiting on a lock
- BroadcastReceiver onReceive doing heavy work

## Quick fix

1. Move work to background (coroutines, WorkManager)
2. Enable StrictMode in debug to catch disk/network on main
3. Read the ANR trace to find the blocking call

## Detailed fix by platform

### Kotlin

1. `if (BuildConfig.DEBUG) StrictMode.setThreadPolicy(StrictMode.ThreadPolicy.Builder().detectAll().penaltyLog().build())`

### ADB

1. `adb bugreport ./anr-report.zip   # contains /data/anr traces`

## How to diagnose

1. **Trace** — Main thread stack in the ANR report
2. **Vitals** — Play Console ANR clusters

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/android/anr-application-not-responding)
