diff --git a/WanderlogPatches.md b/WanderlogPatches.md index 04ec1e4467f7a4..a6200477da2317 100644 --- a/WanderlogPatches.md +++ b/WanderlogPatches.md @@ -51,3 +51,6 @@ rebase on upstream's `main` - Wrap NullPointerExceptions when thrown by native code called from JS for readability - Summary: These crashing exceptions were really hard to debug in Bugsnag since they don't print the method name. We wrap it and add that. - Pull request: https://github.com/facebook/react-native/pull/38060 +- Fix flipper for Xcode 15.3 + - Summary: Official upstream patch: Xcode 15.3 requires us to add a new import of #include to ios/Pods/Flipper/xplat/Flipper/FlipperTransportTypes.h + - Pull request: https://github.com/facebook/react-native/pull/43345 diff --git a/scripts/cocoapods/utils.rb b/scripts/cocoapods/utils.rb index e5cc2e3c3df7b1..cf1fc1be465380 100644 --- a/scripts/cocoapods/utils.rb +++ b/scripts/cocoapods/utils.rb @@ -131,6 +131,27 @@ def self.apply_mac_catalyst_patches(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' + if !File.exist?(file_path) + return + end + + contents = File.read(file_path) + if contents.include?('#include ') + return + end + 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 + private def self.fix_library_search_path(config) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 88199595db674d..b7096728f2e3d3 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -223,6 +223,7 @@ def react_native_post_install(installer, react_native_path = "../node_modules/re ReactNativePodsUtils.exclude_i386_architecture_while_using_hermes(installer) ReactNativePodsUtils.fix_library_search_paths(installer) ReactNativePodsUtils.set_node_modules_user_settings(installer, react_native_path) + ReactNativePodsUtils.fix_flipper_for_xcode_15_3(installer) NewArchitectureHelper.set_clang_cxx_language_standard_if_needed(installer) is_new_arch_enabled = ENV['RCT_NEW_ARCH_ENABLED'] == "1"