Flutterアプリ開発で、iOSシミュレーターでビルドした際に以下のエラーが発生しました。ビルドはAndroid Studioで実行しました。
Xcode build done. 2.0s
Failed to build iOS app
Error output from Xcode build:
↳
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:A68EF777-8892-47F5-AFA3-F09ECEC944D0 }
Ineligible destinations for the "Runner" scheme:
{ platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device, error:iOS 17.4 is not installed. To use with Xcode, first download and install the platform }
Xcode's output:
↳
Writing result bundle at path:
/var/folders/g1/f_fgn05d3nbb5z8kk3dlh5fh0000gn/T/flutter_tools.S8ZMyW/flutter_ios_build_temp_dir6Tc5Wm/temporary_xcresult_bundle
Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.
解決方法
Xcodeで開いてみると、「iOS 17.4 Not Installed」の表示がありました。

すぐ横の「Get」をクリックします。すると、iOS 17.4 Shimulatorのインストールが開始されました。

完了するまで待ちます。

完了後、再びAndroid Studioでビルドすると、次のエラーが発生しました。
Error (Xcode): DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead
Could not build the application for the simulator.
Error launching application on iPhone 15 Pro.
これは、こちらの手順で解決することができました。
これにより、無事、ビルドが成功しました。