Skip to content

Commit

Permalink
Fix React-bridging header not found for third party modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Kudo committed Jul 20, 2022
1 parent 30d1e20 commit fa2acc3
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/react_native_pods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down

0 comments on commit fa2acc3

Please sign in to comment.