我重新启动VScode后,我无处不在开始出现此新错误
Compiler message:
../../flutter/packages/flutter/lib/src/services/asset_bundle.dart:221:7: Error: 'sethrow' isn't a type.
sethrow FlutterError('Unable to load asset: $key');
^^^^^^^
../../flutter/packages/flutter/lib/src/services/asset_bundle.dart:221:15: Error: Expected ';' after this.
sethrow FlutterError('Unable to load asset: $key');
^^^^^^^^^^^^
Target kernel_snapshot failed: Exception: Errors during snapshot creation: null
Failed to build bundle.
Error launching application on iPhone 11 Pro Max.
我的pubspec.yaml看起来像这样
flutter:
uses-material-design: true
assets:
- assets/images/couplephone.png
- assets/images/background.jpeg
- assets/images/logo.png
- assets/images/avatar.png
试图弄清楚,但是谷歌没有帮助,因为我找不到很多信息。
编辑:我现在在所有flutter项目中都遇到此错误
答案 0 :(得分:-1)
在我的Mac中重新安装了flutter,一切又恢复正常了。