From a3b66de98e29b037c66e5bb449f7e9de5f1ed3b1 Mon Sep 17 00:00:00 2001 From: Kudo Chien Date: Tue, 19 Jul 2022 01:20:33 +0800 Subject: [PATCH] Fix React-bridging header not found for third party modules --- scripts/react_native_pods.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 265fff1b649543..e7c59ad5f874d3 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -268,6 +268,18 @@ def fix_config(config) end end +def fix_react_bridging_header_search_paths(installer) + installer.target_installation_results.pod_target_installation_results + .each do |pod_name, target_installation_result| + target_installation_result.native_target.build_configurations.each do |config| + # For third party modules who have React-bridging dependency to search correct headers + config.build_settings['HEADER_SEARCH_PATHS'] ||= '$(inherited) ' + config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_ROOT)/Headers/Private/React-bridging/react/bridging" ' + config.build_settings['HEADER_SEARCH_PATHS'] << '"$(PODS_CONFIGURATION_BUILD_DIR)/React-bridging/react_bridging.framework/Headers" ' + end + end +end + def set_node_modules_user_settings(installer, react_native_path) puts "Setting REACT_NATIVE build settings" projects = installer.aggregate_targets @@ -291,6 +303,7 @@ def react_native_post_install(installer, react_native_path = "../node_modules/re exclude_architectures(installer) fix_library_search_paths(installer) + fix_react_bridging_header_search_paths(installer) cpp_flags = DEFAULT_OTHER_CPLUSPLUSFLAGS if ENV['RCT_NEW_ARCH_ENABLED'] == '1'