react-native-screens: iOS Crash When use_frameworks! and use ENV['RCT_NEW_ARCH_ENABLED'] = '1'
Description
iOS Crash When use_frameworks! and use ENV[‘RCT_NEW_ARCH_ENABLED’] = ‘1’
CrashInfo
Running "TestRNScreen" with {"rootTag":1,"initialProps":{"concurrentRoot":true},"fabric":true}
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RNSScreenStackHeaderConfig setHide:]: unrecognized selector sent to instance 0x10692df90'
Env
System:
OS: macOS 14.5
CPU: (12) arm64 Apple M2 Max
Memory: 99.48 MB / 32.00 GB
Shell:
version: "5.9"
path: /bin/zsh
Binaries:
Node:
version: 18.18.2
path: ~/.nvm/versions/node/v18.18.2/bin/node
Yarn:
version: 3.6.4
path: ~/.nvm/versions/node/v18.18.2/bin/yarn
npm:
version: 9.8.1
path: ~/.nvm/versions/node/v18.18.2/bin/npm
Watchman:
version: 2024.05.06.00
path: /opt/homebrew/bin/watchman
Managers:
CocoaPods:
version: 1.15.2
path: /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms:
- DriverKit 23.5
- iOS 17.5
- macOS 14.5
- tvOS 17.5
- visionOS 1.2
- watchOS 10.5
Android SDK:
API Levels:
- "31"
- "34"
Build Tools:
- 33.0.1
- 34.0.0
- 35.0.0
System Images:
- android-34 | Google APIs ARM 64 v8a
Android NDK: Not Found
IDEs:
Android Studio: 2022.3 AI-223.8836.35.2231.10406996
Xcode:
version: 15.4/15F31d
path: /usr/bin/xcodebuild
Languages:
Java:
version: 20.0.2.1
path: /usr/bin/javac
Ruby:
version: 3.1.2
path: /Users/yangcankun/.rvm/rubies/ruby-3.1.2/bin/ruby
npmPackages:
"@react-native-community/cli": Not Found
react:
installed: 18.2.0
wanted: 18.2.0
react-native:
installed: 0.74.3
wanted: 0.74.3
react-native-macos: Not Found
npmGlobalPackages:
"*react-native*": Not Found
Android:
hermesEnabled: true
newArchEnabled: false
iOS:
hermesEnabled: false
newArchEnabled: true
Reason i guess
fabric doesn’t support use_frameworks! ,when use_frameworks! fabric will set RCT_DYNAMIC_FRAMEWORKS=1 to backward compatibility.
You can use my demo to reproduce the crash
Steps to reproduce
- use_frameworks!
- ENV[‘RCT_NEW_ARCH_ENABLED’] = ‘1’
- pod install
- run
Snack or a link to a repository
https://github.com/Yck-Dakucha/TestRNScreenCrash
Screens version
3.32.0
React Native version
0.74.3
Platforms
iOS
JavaScript runtime
JSC
Workflow
React Native (without Expo)
Architecture
Fabric (New Architecture)
Build type
Debug mode
Device
iOS simulator
Device model
iPhone 15 Pro (17.5)
Acknowledgements
Yes
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 21 (9 by maintainers)
well react-native 0.76.0 was just released today so anyone who creates a new react native app wont be able to use this library because of this crash because the new arch is turned on by default
Yes, there is no problem with the static library. The problem is that when using the dynamic library, fabric will use the old architecture to call native-components for backward compatibility. This is the direct cause of the crash, because RNScreens makes different View attributes in the new and old architectures, but only uses the judgment of whether it is the new architecture, and is not compatible with fabric backward compatibility.