当我尝试在 VSCode 中运行我的应用程序时出现此错误。
FAILURE: Build failed with an exception.
* Where:
Script 'C:\Users\Omar\Documents\flutter\packages\flutter_tools\gradle\flutter.gradle' line: 1035
* What went wrong:
Execution failed for task ':app:compileFlutterBuildDebug'.
> Process 'command 'C:\Users\Omar\Documents\flutter\bin\flutter.bat'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
这是因为我在 pubspec.yaml 文档中放入了一些图像。文档本身和图像运行良好,所以我不明白为什么会发生这种情况。我写了一个新项目,也发生了同样的事情。 (再次,当我要放置图像时)。
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/twitter1.png
- assets/instagram1.png
- assets/discord1.png
此外,出于某种原因,如果我执行 flutter clean
和 flutter pub get
,我可以运行我的项目,但它只运行一次,一旦我尝试第二次,我必须按照以下步骤操作再来一次。
我一直在阅读其他关于此问题的帖子,但我仍然没有找到任何解决方案,更接近于前面提到的。