Skip to content

Commit 7861f35

Browse files
author
wanggangfeng
committed
fix(ios): resolve ImportReact.h in Expo modular builds
DEFINES_MODULE generates an umbrella that imports public headers, but ImportReact.h was public-only and the hyphenated Headers/Public path was not on the search list, so Expo SDK 57 compiles failed.
1 parent 583801a commit 7861f35

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

‎react-native-update.podspec‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,11 @@ Pod::Spec.new do |s|
9595
# relative to the including file (the cpp/ core via ../../cpp/...), and the
9696
# former absolute "#{podspec_dir}/ios" entry made the generated xcconfig
9797
# machine-specific.
98+
# DEFINES_MODULE writes the umbrella under Headers/Public/react_native_update/
99+
# (underscores). CocoaPods copies public headers to react-native-update/
100+
# (hyphens). Include the latter so the umbrella can #import "ImportReact.h".
98101
s.pod_target_xcconfig = {
99-
'USER_HEADER_SEARCH_PATHS' => "\"$(PODS_ROOT)/Headers/Public/SSZipArchive\" \"$(PODS_ROOT)/Headers/Public/React-Codegen/RCTPushySpec\"",
102+
'USER_HEADER_SEARCH_PATHS' => "\"$(PODS_ROOT)/Headers/Public/react-native-update\" \"$(PODS_ROOT)/Headers/Public/SSZipArchive\" \"$(PODS_ROOT)/Headers/Public/React-Codegen/RCTPushySpec\"",
100103
"DEFINES_MODULE" => "YES"
101104
}
102105
# buildTime for binary-rebuild detection (SyncBinaryVersion) and the check
@@ -137,6 +140,10 @@ Pod::Spec.new do |s|
137140

138141
# Conditionally add Expo dependency
139142
if valid_expo_project
143+
# DEFINES_MODULE lists public headers in the umbrella. Marking
144+
# ImportReact.h public without source_files leaves it out of
145+
# Headers/Public, so compiling the Swift module fails.
146+
s.source_files = 'ios/ImportReact.h'
140147
s.public_header_files = ['ios/ImportReact.h']
141148
s.dependency 'ExpoModulesCore'
142149
end

0 commit comments

Comments
 (0)