diff --git a/packages/react-native/scripts/cocoapods/new_architecture.rb b/packages/react-native/scripts/cocoapods/new_architecture.rb index 1b66a14684..192d270264 100644 --- a/packages/react-native/scripts/cocoapods/new_architecture.rb +++ b/packages/react-native/scripts/cocoapods/new_architecture.rb @@ -16,7 +16,8 @@ class NewArchitectureHelper language_standard = nil installer.pods_project.targets.each do |target| - if target.name == 'React-Core' + # The React-Core pod may have a suffix added by Cocoapods, so we test whether 'React-Core' is a substring, and do not require exact match + if target.name.include? 'React-Core' language_standard = target.resolved_build_setting("CLANG_CXX_LANGUAGE_STANDARD", resolve_against_xcconfig: true).values[0] end end @@ -61,7 +62,8 @@ class NewArchitectureHelper # Add RCT_NEW_ARCH_ENABLED to generated pod target projects installer.target_installation_results.pod_target_installation_results.each do |pod_name, target_installation_result| - if pod_name == 'React-Core' + # The React-Core pod may have a suffix added by Cocoapods, so we test whether 'React-Core' is a substring, and do not require exact match + if pod_name.include? 'React-Core' target_installation_result.native_target.build_configurations.each do |config| config.build_settings['OTHER_CPLUSPLUSFLAGS'] = @@new_arch_cpp_flags end