Failed to build iOS app
Could not build the precompiled application for the device.
Error (Xcode): unsupported option '-G' for target 'arm64-apple-ios10.0'
Error launching application on iPhoneSE.
solution:
markchiu@MacPro ios % pod update
Update all pods
Updating local specs repositories
CocoaPods 1.15.0 is available.
To update use: `gem install cocoapods`
For more information, see https://blog.cocoapods.org and the CHANGELOG for this version at https://github.com/CocoaPods/CocoaPods/releases/tag/1.15.0
after that, you need to update pod using below command
pod setup
You can check pod version using below command
pod --version
step2: 再參考這一片文章:
https://github.com/firebase/flutterfire/issues/13342
You have to go to Xcode => Runner => Build Settings and put "Allow Non-modular Includes In Framework Modules" to "yes"
第三步:增加 if target.name == 'BoringSSL-GRPC'...相關code在 Podfile
post_install do |installer|
installer.pods_project.targets.each do |target|
//other code may in there.
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
參考:https://stackoverflow.com/questions/78608693/boringssl-grpc-unsupported-option-g-for-target-arm64-apple-ios15-0
成功!3個步驟搞定,可以成功build ios app.

