debug-rn-native-crash

Diagnose native React Native Fabric and Hermes crashes in iOS apps using Xcode and lldb.

615|491|Updated Jan 4, 2022
One-click install
npx skills add https://github.com/LedgerHQ/ledger-live --skill debug-rn-native-crash
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: debug-rn-native-crash
Source: https://github.com/LedgerHQ/ledger-live/tree/main/.agents/skills/debug-rn-native-crash
Command: npx skills add https://github.com/LedgerHQ/ledger-live --skill debug-rn-native-crash

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

React Native apps sometimes crash with only a native iOS stack trace (NSException, Fabric assertion) and no actionable JS error, leaving developers stuck. This Skill provides a systematic workflow to capture the native exception, reproduce it under the Xcode debugger, and trace the crash back to the exact React component responsible.

Core Features & Use Cases

  • Native exception capture: Pull crash logs from the iOS simulator with xcrun simctl predicates and decode Fabric assertion fields like tag, frame, alpha, and backgroundColor.
  • lldb component identification: Use Xcode exception breakpoints and lldb commands to traverse the UIView hierarchy, find accessibilityIdentifier (RN testID) values, and grep them back to source components.
  • Crash pattern catalogue: Match crashes against five common Fabric patterns including unstable keyExtractor, Reanimated animations running through unmount, and conditional rendering swaps, each with concrete fixes.
  • Use Case: The Ledger Live mobile app dies with "Attempt to unmount a view which is mounted inside different view" and no JS stack. Follow the workflow to identify the orphan Skeleton component, apply the opacity-based fix, and verify Metro served the change.

Quick Start

Debug the native iOS crash in ledger-live-mobile that shows only a Fabric assertion with no JS stack trace.

Frequently Asked Questions about debug-rn-native-crash

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

FAQPage Schema
How do I debug a React Native crash with no JS stack trace?

Capture the native exception from the iOS simulator using xcrun simctl log show with a predicate filtering for assertion failures, then reproduce the crash in Xcode with an Objective-C exception breakpoint. Use lldb to inspect the view descriptors and climb the superview chain to a recognizable testID.

What causes 'Attempt to unmount a view which is mounted inside different view' in React Native Fabric?

This Fabric assertion usually comes from unstable keyExtractor functions, Reanimated animations running through component unmount, inline JSX recreated every render in FlatList sticky headers, or conditional rendering that swaps component types under the same parent.

How do I find which React component caused a native iOS crash?

Pause on objc_exception_throw in Xcode, then use lldb commands like po [oldChildViewDescriptor.view accessibilityIdentifier] to read the RN testID. Climb superviews until you find a set identifier, then grep your source for that testID to locate the component.

Why do my React Native fixes not appear after editing the code?

Metro's file watcher can silently die with an EMFILE too many open files error, so edits never reach the bundle. Restart Metro with --reset-cache and confirm a fresh Compiled ios line appears in Metro output after each edit.

When should I not use native crash debugging for React Native?

Skip native debugging when the JS console already shows a clear stack trace, since reading the JS error directly is faster. Native debugging is only needed for silent crashes, NSExceptions, or native-only stack traces.

How do I confirm a crash is Fabric-specific in React Native?

Set RCT_NEW_ARCH_ENABLED to 0 in the iOS Podfile, run pod install, and rebuild. If the crash disappears on the old Paper renderer, the bug is Fabric-specific. Revert the Podfile and lockfile changes before committing.