[flutter]M系MacでiOSシミュレータでデバッグ時、ビルドに失敗する

Armでは対応していないパッケージを使っている場合、ビルド時にエラーが発生するので対処を行う必要があります。

エラー内容

building for iOS Simulator, but linking in object file built for iOS, 
file '/Users/userName/projects/FlutterProjects/appName/ios/Pods/GoogleSignIn/Frameworks/GoogleSignIn.framework/GoogleSignIn' 
for architecture arm64

対策

まずはFInderにて[プロジェクトルート]-[ios]-[Runner.xcworkspace]をXcodeで開きます。
[Runner]-[PROJECT Runner]-[Build Settings]と選択していきます。

タブ内にて最初はBasicが選択されているので、これをAllに変更するとArchitecturesの中にExcluded Architecturesが表示されるので、以下のように追加してください。

その後、Finderにてiosフォルダ内にあるPodfileをVSCode等のエディタで開きます。
以下の記述を追加してください。

post_install do |installer|
  installer.pods_project.build_configurations.each do |config|
    config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
  end
end

そして以下のコマンドを実行。

flutter clean
flutter pub get

を行ってください。flutter cleanを行うとPodsの設定もリセットされるので注意。