这是我的
PodFile
platform :ios, min_ios_version_supported
use_modular_headers!
prepare_react_native_project!
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
linkage = ENV['USE_FRAMEWORKS']
if linkage != nil
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
use_frameworks! :linkage => linkage.to_sym
end
target 'Fixturefix' do
config = use_native_modules!
# Flags change depending on the env values.
flags = get_default_flags()
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'react-native-config/Extension', :path => '../node_modules/react-native-config'
$RNFirebaseAsStaticFramework = true
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
:flipper_configuration => flipper_config,
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'FixturefixTests' do
inherit! :complete
end
post_install do |installer|
react_native_post_install(
installer,
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
if ['FirebaseCoreInternal', 'GoogleUtilities'].include?(target.name)
target.build_configurations.each do |config|
config.build_settings['DEFINES_MODULE'] = 'YES'
end
end
end
end
end
我使用的是配备 Sequoia 15.0 的 MacBook M1 Xcode 版本 16.0 然后我在 Xcode 上构建时不断收到此错误。我对构建和运行新项目没有任何问题。 目标“arm64-apple-ios11.0-simulator”不支持选项“-G” 我尝试过的事情。
rm -rf Podfile
rm -rf Podfile.lock
Pod install
Also tried
pod deintegrate
pod install
仔细检查iOS版本16.0 我在这方面损失了几天,请帮忙,
我在这里使用相同的方法解决了问题:BoringSSL-GRPC unsupported option '-G' for target 'arm64-apple-ios15.0'
几乎只需将你的 podfile 修改为:
pod 'Firebase', :modular_headers => true
pod 'FirebaseCore', :modular_headers => true
pod 'GoogleUtilities', :modular_headers => true
pod 'react-native-config/Extension', :path => '../node_modules/react-native-config'
$RNFirebaseAsStaticFramework = true
use_react_native!(
:path => config[:reactNativePath],
:hermes_enabled => flags[:hermes_enabled],
:fabric_enabled => flags[:fabric_enabled],
:flipper_configuration => flipper_config,
:app_path => "#{Pod::Config.instance.installation_root}/.."
)
target 'FixturefixTests' do
inherit! :complete
end
post_install do |installer|
react_native_post_install(
installer,
:mac_catalyst_enabled => false
)
__apply_Xcode_12_5_M1_post_install_workaround(installer)
installer.pods_project.targets.each do |target|
if target.name == 'BoringSSL-GRPC'
target.source_build_phase.files.each do |file|
if file.settings && file.settings['COMPILER_FLAGS']
flags = file.settings['COMPILER_FLAGS'].split
flags.reject! { |flag| flag == '-GCC_WARN_INHIBIT_ALL_WARNINGS' }
file.settings['COMPILER_FLAGS'] = flags.join(' ')
end
end
end
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
end
if ['FirebaseCoreInternal', 'GoogleUtilities'].include?(target.name)
target.build_configurations.each do |config|
config.build_settings['DEFINES_MODULE'] = 'YES'
end
end
end
end
end
运行
pod upgrade
清理构建文件夹并再次构建。
希望对你有帮助!