2024年9月22日 星期日

flutter build ios Error (Xcode): unsupported option '-G' for target 'arm64-apple-ios10.0'

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




step 1: 試著更新cocopods.

sudo gem install cocoapods

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.

沒有留言:

張貼留言

Dart 不允許函數重載??? Dart doesn't permit function overloading.

在Java 中,函數重載(method overloading)是允許的,即可以有多個函數具有相同的名稱,但是參數類型或數量不同。 編譯器可以根據函數的參數類型或數量來選擇正確的函數進行呼叫。 class Calculator {      // 方法1:兩個整數相加      ...