diff --git a/packages/react-native/scripts/cocoapods/new_architecture.rb b/packages/react-native/scripts/cocoapods/new_architecture.rb index 8c7508b5400f04..2eaef9127dcc2c 100644 --- a/packages/react-native/scripts/cocoapods/new_architecture.rb +++ b/packages/react-native/scripts/cocoapods/new_architecture.rb @@ -133,9 +133,13 @@ def self.install_modules_dependencies(spec, new_arch_enabled, folly_version = He depend_on_js_engine(spec) add_rn_third_party_dependencies(spec) - add_rncore_dependency(spec) spec.pod_target_xcconfig = current_config + + # add_rncore_dependency must be called after setting pod_target_xcconfig + # because it reads and modifies the xcconfig. If called before, its changes + # would be overwritten by the assignment above. + add_rncore_dependency(spec) end def self.extract_react_native_version(react_native_path, file_manager: File, json_parser: JSON) diff --git a/packages/react-native/scripts/ios-prebuild/React-umbrella.h b/packages/react-native/scripts/ios-prebuild/templates/React-umbrella.h similarity index 99% rename from packages/react-native/scripts/ios-prebuild/React-umbrella.h rename to packages/react-native/scripts/ios-prebuild/templates/React-umbrella.h index 45b365b92b9a58..b8d6abc5d2ab9b 100644 --- a/packages/react-native/scripts/ios-prebuild/React-umbrella.h +++ b/packages/react-native/scripts/ios-prebuild/templates/React-umbrella.h @@ -6,7 +6,7 @@ */ #ifdef __OBJC__ -#import +#import "UIKit/UIKit.h" #else #ifndef FOUNDATION_EXPORT #if defined(__cplusplus) diff --git a/packages/react-native/scripts/ios-prebuild/React_RCTAppDelegate-umbrella.h b/packages/react-native/scripts/ios-prebuild/templates/React_RCTAppDelegate-umbrella.h similarity index 100% rename from packages/react-native/scripts/ios-prebuild/React_RCTAppDelegate-umbrella.h rename to packages/react-native/scripts/ios-prebuild/templates/React_RCTAppDelegate-umbrella.h diff --git a/packages/react-native/scripts/ios-prebuild/module.modulemap b/packages/react-native/scripts/ios-prebuild/templates/module.modulemap similarity index 100% rename from packages/react-native/scripts/ios-prebuild/module.modulemap rename to packages/react-native/scripts/ios-prebuild/templates/module.modulemap diff --git a/packages/react-native/scripts/ios-prebuild/xcframework.js b/packages/react-native/scripts/ios-prebuild/xcframework.js index 236103b1a36153..1ff9f992ca2b9f 100644 --- a/packages/react-native/scripts/ios-prebuild/xcframework.js +++ b/packages/react-native/scripts/ios-prebuild/xcframework.js @@ -31,6 +31,7 @@ const frameworkLog = createLogger('XCFramework'); */ const REACT_CORE_UMBRELLA_HEADER_PATH /*: string*/ = path.join( __dirname, + 'templates', 'React-umbrella.h', ); @@ -40,10 +41,15 @@ const REACT_CORE_UMBRELLA_HEADER_PATH /*: string*/ = path.join( */ const RCT_APP_DELEGATE_UMBRELLA_HEADER_PATH /*: string*/ = path.join( __dirname, + 'templates', 'React_RCTAppDelegate-umbrella.h', ); -const RN_MODULEMAP_PATH /*: string*/ = path.join(__dirname, 'module.modulemap'); +const RN_MODULEMAP_PATH /*: string*/ = path.join( + __dirname, + 'templates', + 'module.modulemap', +); function buildXCFrameworks( rootFolder /*: string */,