我的pubspec.yaml文件面临一个问题。我在我的pubspec.yaml文件中添加了一个图像,添加之后,当我运行flutter pub get时,我得到了这个错误
在
中检测到pubspec.yaml错误:意外的子程序“要将资产添加到应用程序中,添加一个资产部分,如”在“颤振”下“找到”。请在用退出代码1完成的/home/emmanuel/StudioProjects/gctu_app/pubspec.yaml过程中更正pubspec.yaml文件
我还尝试了运行flutter clean、flutter build和pub upgrade,但这也产生了同样的错误。我该怎么解决这个问题。
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:
- images/
# - images/a_dot_ham.jpeg发布于 2022-09-27 23:10:46
忘记在“向应用程序添加资产,添加资产部分”之前添加#,如下所示:
所以你的yml
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:
- images/
# - images/a_dot_ham.jpeghttps://stackoverflow.com/questions/73874555
复制相似问题