Skip to content
Back to skills

Handle Anr Android

ASecurity

Diagnose and fix ANRs (Application Not Responding) which Play penalizes at above 0.47% threshold. Use when the user says 'fix anr', 'anr android', 'app not responding'.

  • 3 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added October 4, 2026
developmentgoreactperformance

Works with

  • cli

Security analysis

A100/100

Pro scans all 2 files and shows the line behind each finding

Scanned October 4, 2026

npx -y skills add khadinakbarlabs/expo-mobile-app-builder --skill handle-anr-android --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Handle Anr Android?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Handle Anr Android
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/khadinakbarlabs-handle-anr-android/badge)](https://www.skillsdirectory.com/skills/khadinakbarlabs-handle-anr-android)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: "handle-anr-android"
description: "Diagnose and fix ANRs (Application Not Responding) which Play penalizes at above 0.47% threshold. Use when the user says 'fix anr', 'anr android', 'app not responding'."
---

# Handle ANR (Application Not Responding)

ANR = main thread blocked >5 sec. Play threshold: <0.47%.

## What causes ANR

- Synchronous network on main thread
- Heavy computation in render
- Disk I/O on main thread
- Bridge serialization of large data (RN-specific)
- Animation conflicting with layout

## Detect

Play Console → Vitals → ANRs. Lists stack traces of recent ANRs.

Sentry → Performance → "ANR" issue type.

## Fix patterns

### Move heavy work off main thread
```tsx
// Bad: parsing large JSON on main thread
const data = JSON.parse(hugeString);

// Good: use InteractionManager or worklet
import { InteractionManager } from 'react-native';
InteractionManager.runAfterInteractions(() => {
  const data = JSON.parse(hugeString);
});
```

### Use React Native worklets
```tsx
import { runOnJS, runOnUI } from 'react-native-reanimated';

const heavyCompute = () => {
  'worklet';
  // Runs on UI thread, not main JS thread
};
```

### Optimize FlashList
```tsx
<FlashList
  estimatedItemSize={80}  // critical
  getItemType={(item) => item.type}  // reduce re-renders
  removeClippedSubviews  // free memory
/>
```

### Reduce bridge traffic
```tsx
// Bad: passing array of 1000 objects through bridge
<HeavyComponent data={hugeArray} />

// Good: virtualize, only pass visible items
<FlashList data={hugeArray} renderItem={({ item }) => <Row item={item} />} />
```

## Common gotchas
- Setting state during render → re-render storm
- Synchronous bridge calls (RN Pre-Fabric) → ANR
- Image decoding 1000 thumbnails → use expo-image with proper priority

## Pair with
- `add-flashlist`
- `reduce-android-cold-start`
- `add-sentry-rn-android` (ANR tracking)

Files in this skill

  • SKILL.md1.9 KB
  • agents/openai.yaml185 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…