-
-
Notifications
You must be signed in to change notification settings - Fork 606
Description
Native crash (EXC_BAD_ACCESS) on iOS Simulator x86_64 with New Architecture
Description
The app crashes immediately on iOS Simulator (x86_64 architecture on Intel Mac) when using @react-navigation/native-stack with react-native-screens and React Native New Architecture enabled. The crash is a native crash (EXC_BAD_ACCESS / SIGSEGV) caused by an Objective-C exception: -[UIResponder doesNotRecognizeSelector:].
The crash occurs in the stack trace involving:
RCTComponentData.mmRCTLegacyViewManagerInteropRCTMountingManager
This suggests that a native view is being set with a prop/selector that it doesn't recognize, and with RN New Architecture/Fabric, it crashes immediately instead of just showing a warning.
Screens version
4.19.0
React Native version
0.83.1
Platforms
- iOS Simulator (x86_64 architecture on Intel Mac) - ❌ Crashes
- iOS Physical Device (arm64) - ✅ Works fine
- Android (both emulator and device) - ✅ Works fine
Steps to Reproduce
- Create a new React Native project with New Architecture enabled
- Install dependencies:
npm install [email protected] @react-navigation/[email protected] @react-navigation/[email protected]
- Set up
NavigationContainerwithcreateNativeStackNavigator(see minimal reproduction code below) - Run the app on iOS Simulator (x86_64 architecture on Intel Mac)
- App crashes immediately on launch
Snack or a link to a repository
Minimal reproduction code:
The following minimal code is sufficient to reproduce the crash:
// App.js
import React from 'react';
import { View } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { createNativeStackNavigator } from '@react-navigation/native-stack';
const Stack = createNativeStackNavigator();
function TestScreen() {
return <View style={{ flex: 1, backgroundColor: 'white' }} />;
}
function App() {
return (
<NavigationContainer>
<Stack.Navigator>
<Stack.Screen name="Test" component={TestScreen} />
</Stack.Navigator>
</NavigationContainer>
);
}
export default App;To reproduce:
- Create a new React Native 0.83.1 project with New Architecture enabled
- Install:
npm install [email protected] @react-navigation/[email protected] @react-navigation/[email protected] - Replace
App.jswith the code above - Run on iOS Simulator (x86_64 on Intel Mac)
- App crashes immediately on launch
Note: This is a native crash that occurs during initialization, so the minimal code above is sufficient to reproduce. A full repository would contain the same code plus standard React Native project setup files.
Expected Behavior
The app should run normally on iOS Simulator without crashing, similar to how it works on:
- iOS physical devices
- Android (both emulator and physical devices)
Actual Behavior
The app crashes immediately on iOS Simulator (x86_64) with:
- Crash Type:
EXC_BAD_ACCESS/SIGSEGV - Exception:
-[UIResponder doesNotRecognizeSelector:] - Stack Trace: Involves
RCTComponentData.mm→RCTLegacyViewManagerInterop→RCTMountingManager
Additional Observations
- Isolation Test Results:
- App with only
<View />→ ✅ No crash - App with
NavigationContainer+createNativeStackNavigator(no other screens) → ❌ Same crash - This confirms the crash is specifically from
@react-navigation/native-stack/react-native-screens
- App with only
Related Issues
This might be related to:
- Compatibility issues between
react-native-screensand New Architecture on iOS Simulator x86_64 - Missing prop/selector validation in the Fabric interop layer
- Architecture-specific code paths not being tested on x86_64 simulator
Additional Context
According to the react-native-screens compatibility table, version 4.19.0+ should support React Native 0.81.0+ with Fabric. However, there seems to be an issue specifically with iOS Simulator x86_64 architecture.
System Information
- macOS: 15.4.1
- Xcode: 16.4
- Node: >=18
- CocoaPods: 1.16.2
- New Architecture: Enabled (Fabric)
- Hermes: Enabled
Note: This issue does not affect Android, suggesting it's iOS-specific, possibly related to how Objective-C runtime handles unrecognized selectors differently from Java/Kotlin on Android.