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

 然后重新运行就好了

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

 有时候某次的修改main.dart代码有可能导致Android studio再次自动导入 import dart:html导致再次编译失败,只需要再次注释或者删除即可 

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

猜你喜欢

转载自blog.csdn.net/zxc8890304/article/details/130425111