Understanding and debugging ANR's (Android Not Responding)
summary
Explains how to read the ANR traces.txt snapshot to find the actual culprit: main thread states like main thread sleeping 30s or blocked waiting on TID 19 sample writer thread, and how that maps back to code. Shows concrete fixes: move heavy shared‑prefs reads (2–3 MB) off the UI thread, replace with DataStore or smaller prefs, use thread pools or WorkManager to avoid long locks, run StrictMode and Android Studio Profiler to spot disk IO and GC spikes.
AI-written summary · about
chapters (8)
- 0:00Introduction to ANRs
- 1:49Understanding ANR traces.txt
- 3:14Analyzing ANR traces examples
- 5:42Debugging blocked main thread
- 7:48Common ANR causes and fixes
- 9:35Advanced debugging techniques
- 11:01Preventing ANRs with thread policy
- 11:41Q&A
related talks
39mWhere Is Your ANR Coming From? — Diagnosing How It Occurs and Prescribing Remedies by Symptom
19mRevolutionizing ANR Detection at Sentry
29mWhy ANRs are Hard to Solve and What You Can Do to Make it Easier
29mHow the Android Framework Monitors, Processes, and Triggers ANRs
22mANR overview at Uber + Leveraging ApplicationExitInfo API
29mHow the Android Framework Monitors, Processes, and Triggers ANRs
39mUnblocking The Main Thread: Solving ANRS and Frozen Frames
24mMake the Most of Android Vitals
