anr-audit-and-fix

Analyzes Android codebases for ANR risks and diagnoses stack dumps.

9.3k|601|Updated Mar 16, 2026
Ready to run
npx skills add https://github.com/android/skills --skill anr-audit-and-fix-android
💬 Prompt for ChatGPT / Claude Chat▼
Please help me install this Agent Skill.
Skill: anr-audit-and-fix
Source: https://github.com/android/skills/tree/main/performance/anr-audit-and-fix
Command: npx skills add https://github.com/android/skills --skill anr-audit-and-fix-android

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Developers encounter frequent Application Not Responding issues in Android applications due to main thread blocking or incorrect threading. This skill provides systematic auditing and diagnosis to identify and resolve these problems efficiently. ## Core Features & Use Cases - Static ANR risk audit on source files following detailed checklists. - Trace-driven diagnosis of ANR stack dumps using structured templates. - Remediation for threading violations and blocking operations. - Use Case: Scan Android code for ANR risks or triage stack dumps to prevent user-facing freezes. ## Quick Start Provide Android source files or ANR stack dumps to the skill for risk assessment and diagnosis.

Frequently Asked Questions about anr-audit-and-fix

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit Android code for ANR risks?▼

The skill uses a step-by-step risk analysis guide to list candidates, prove the executing thread, prove blocking, and attribute findings with severity grades.

What is used to diagnose ANR stack dumps?▼

The trace analysis guide and anr_trace_report_template.md are used to format reports with overview, system health, root cause, and remediation sections.

How to fix sync barrier leak ANR risks?▼

Mutations of attached Views must occur on the main thread by starting coroutines on Dispatchers.Main and wrapping I/O in withContext(Dispatchers.IO).

When is an ANR verdict external bottleneck?▼

When the unresponsive thread shows no app-side blocking dependency and the device is saturated by other processes or kernel I/O.

Does the skill support Android version checks?▼

Detection for Android 17+ uses View.registerCalledFromWrongThreadListener and compatibility flags for older versions.