diff --git a/packages/react-native/scripts/cocoapods/utils.rb b/packages/react-native/scripts/cocoapods/utils.rb index 54ea36ce5fdaad..4654adc3ccb15d 100644 --- a/packages/react-native/scripts/cocoapods/utils.rb +++ b/packages/react-native/scripts/cocoapods/utils.rb @@ -162,7 +162,7 @@ def self.apply_xcode_15_patch(installer, xcodebuild_manager: Xcodebuild) project.build_configurations.each do |config| # fix for weak linking self.safe_init(config, other_ld_flags_key) - if self.is_using_xcode15_or_greater(:xcodebuild_manager => xcodebuild_manager) + if self.is_using_xcode15_0(:xcodebuild_manager => xcodebuild_manager) self.add_value_to_setting_if_missing(config, other_ld_flags_key, xcode15_compatibility_flags) else self.remove_value_to_setting_if_present(config, other_ld_flags_key, xcode15_compatibility_flags) @@ -387,7 +387,7 @@ def self.remove_value_to_setting_if_present(config, setting_name, value) end end - def self.is_using_xcode15_or_greater(xcodebuild_manager: Xcodebuild) + def self.is_using_xcode15_0(xcodebuild_manager: Xcodebuild) xcodebuild_version = xcodebuild_manager.version # The output of xcodebuild -version is something like @@ -398,7 +398,8 @@ def self.is_using_xcode15_or_greater(xcodebuild_manager: Xcodebuild) regex = /(\d+)\.(\d+)(?:\.(\d+))?/ if match_data = xcodebuild_version.match(regex) major = match_data[1].to_i - return major >= 15 + minor = match_data[2].to_i + return major == 15 && minor == 0 end return false