Can’t build Flutter application: Unable to locate DeviceSupport directory解决

错误

Unable to locate DeviceSupport directory with suffix 'DeveloperDiskImage.dmg'. This probably means you don't have Xcode installed, you will need to launch the app manually and logging output will not be shown! Could not run build/ios/iphoneos/Runner.app on 16e0be0d98a45594d66fce5bc03767078a0adaf9. Try launching Xcode and selecting "Product > Run" to fix the problem: open ios/Runner.xcworkspace

分析:DeviceSupport版本支持不兼容,需要更新对应的DeviceSupport。

解决方法

Xcode iPhoneOS DeviceSupport

支持库:https://github.com/filsv/iPhoneOSDeviceSupport

  1. 下载您需要上面列出的版本;
  2. 解压;
  3. 关闭 Xcode;
  4. 通过路径复制和粘贴解压缩文件夹:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/
  5. 重启 Xcode;
Can't build Flutter application: Unable to locate DeviceSupport directory解决