diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 7a3b0823193a65..12213ce7f7cefe 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -86,6 +86,22 @@ def self.exclude_i386_architecture_while_using_hermes(installer) end end + def self.fix_flipper_for_xcode_15_3(installer) + installer.pods_project.targets.each do |target| + if target.name == 'Flipper' + file_path = 'Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h' + contents = File.read(file_path) + unless contents.include?('#include ') + mod_content = contents.gsub("#pragma once", "#pragma once\n#include ") + File.chmod(0755, file_path) + File.open(file_path, 'w') do |file| + file.puts(mod_content) + end + end + end + end + end + def self.set_use_hermes_build_setting(installer, hermes_enabled) Pod::UI.puts("Setting USE_HERMES build settings") projects = self.extract_projects(installer) diff --git a/packages/react-native/scripts/react_native_pods.rb b/packages/react-native/scripts/react_native_pods.rb index 01e68b50a47e91..be8b0cef664d54 100644 --- a/packages/react-native/scripts/react_native_pods.rb +++ b/packages/react-native/scripts/react_native_pods.rb @@ -308,6 +308,7 @@ def react_native_post_install( ReactNativePodsUtils.apply_flags_for_fabric(installer, fabric_enabled: fabric_enabled) ReactNativePodsUtils.apply_xcode_15_patch(installer) ReactNativePodsUtils.updateOSDeploymentTarget(installer) + ReactNativePodsUtils.fix_flipper_for_xcode_15_3(installer) NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer) NewArchitectureHelper.modify_flags_for_new_architecture(installer, NewArchitectureHelper.new_arch_enabled)