BoringSSL-GRPC Unsupported Option in Xcode 16
Problem Statement
After updating to Xcode 16, building an iOS application that includes the BoringSSL-GRPC pod may fail with the error:
BoringSSL-GRPC unsupported option '-G' for target 'arm64-apple-ios15.0'This occurs because Xcode 16 no longer supports the -GCC_WARN_INHIBIT_ALL_WARNINGS compiler flag (represented as -G) for certain build targets. This issue typically arises in Flutter projects when Firebase dependencies are involved, or when using gRPC-specific libraries. Common troubleshooting steps like updating pods (pod update) or adjusting deployment targets often fail to resolve the issue.
Recommended Solutions
Here are the two most effective solutions, prioritized based on effectiveness:
1. Modify Podfile to Remove Problem Flag (Preferred)
Add this post_install script to your ios/Podfile to remove the unsupported flag from the BoringSSL-GRPC target:
post_install do |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
end
endFollow these steps:
- Add the script above to the end of your
Podfile - Execute these terminal commands:
cd ios
pod cache clean --all
rm -rf Pods Podfile.lock
pod install --repo-update
cd ..
flutter clean- Rebuild your project.
2. Update Firebase Plugins
If you use Firebase, update all related dependencies to their latest versions (as of Nov 2024 or newer):
- Update
pubspec.yaml:
dependencies:
firebase_core: ^3.6.0
firebase_auth: ^5.3.1
cloud_firestore: ^5.4.4
firebase_messaging: ^15.1.3
firebase_storage: ^12.3.3
cloud_functions: ^5.1.3- Run:
flutter clean
flutter pub getAdditional Configuration Options
If the primary solutions don't work, combine the Podfile modification with these settings:
Adjust deployment targets in ios/Podfile:
platform :ios, '13.0' # Minimum iOS 13.0Exclude architectures for simulators (in ios/Podfile):
post_install do |installer|
# ... (Previous BoringSSL fix)
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
endEnable non-modular includes (Xcode Build Setting):
- Open your project in Xcode
- Select the Runner target
- Under Build Settings, search for
ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES - Set it to
YES
Key Notes
- Flutter Cleanup: Always run
flutter cleanafter modifying platform configurations. - Pod Cache: Clear pod caches with
pod cache clean --allif Xcode behaves unexpectedly. - Firebase Versioning: Ensure all Firebase plugins use compatible versions.
Why This Works: The Podfile script surgically removes the problematic -GCC_WARN_INHIBIT_ALL_WARNINGS flag specific to the BoringSSL-GRPC target. The flag became incompatible with Xcode 16's updated toolchain but is unnecessary for functionality. The other configuration tweaks (architecture exclusion, deployment target) handle secondary environment inconsistencies.