Could not build the application for the simulator.

经常会遇到

运行模拟器跑着跑着再重新运行的时候报错

Could not build the application for the simulator.

Error launching application on iPhone 14 Pro Max.

我的解决方案是在VSCode的终端输入

flutter clean

Could not build the application for the simulator._第1张图片 然后重新运行就好了

哦 还有注意你的.dart文件中注释// import 'dart:html';

Could not build the application for the simulator._第2张图片 有时候某次的修改main.dart代码有可能导致Android studio再次自动导入 import dart:html导致再次编译失败,只需要再次注释或者删除即可 

dart:html 只支持 flutter_web 其他平台编译报错

你可能感兴趣的:(Flutter从入门到放弃,iphone,xcode,ios,flutter,android)