Skip to content

Commit 6d73379

Browse files
committed
fix: issue with runtime crash with safe area context
1 parent a31cdd7 commit 6d73379

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

ios/Podfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,20 @@ post_install do |installer|
129129
# target that includes it, we define NDEBUG for ALL targets to set
130130
# folly::kIsDebug=false, disabling the assertion. This matches the
131131
# behavior of Release/Production builds which already define NDEBUG.
132+
#
133+
# However, NDEBUG also triggers flags.h to define REACT_NATIVE_PRODUCTION
134+
# instead of REACT_NATIVE_DEBUG, which changes the layout of the Sealable
135+
# base class (adds std::atomic<bool> in debug mode). The prebuilt RN
136+
# binaries were compiled with REACT_NATIVE_DEBUG active (no NDEBUG), so
137+
# their Props/ViewProps structs are larger. Third-party Fabric components
138+
# (e.g. react-native-safe-area-context) compiled with NDEBUG=1 would see
139+
# a smaller ViewProps, causing an ABI mismatch and EXC_BAD_ACCESS.
140+
# Fix: explicitly define REACT_NATIVE_DEBUG=1 so flags.h skips its
141+
# NDEBUG-based auto-detection, keeping the Sealable debug layout and
142+
# matching the prebuilt ABI, while NDEBUG still silences Folly.
132143
if config.name == 'Debug'
133144
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= []
134-
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] |= ['$(inherited)', 'NDEBUG=1']
145+
config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] |= ['$(inherited)', 'NDEBUG=1', 'REACT_NATIVE_DEBUG=1']
135146
end
136147

137148
end

ios/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2971,6 +2971,6 @@ SPEC CHECKSUMS:
29712971
SwiftAudioEx: f6aa653770f3a0d3851edaf8d834a30aee4a7646
29722972
Yoga: c0b3f2c7e8d3e327e450223a2414ca3fa296b9a2
29732973

2974-
PODFILE CHECKSUM: 3d7504cad11597fb7d7bfae3925a98958b59b233
2974+
PODFILE CHECKSUM: da56a29b6bf5a16bb81cdc901a8a157b31dafb4b
29752975

29762976
COCOAPODS: 1.16.2

0 commit comments

Comments
 (0)