使用资产时Flutter无法建立

Whenever I try to build my app, if the assets: section in pubspec.yaml exists — even if I am not actually using any of the files in there — I get the exception Exception: Build process failed. To view the stack trace, please run `flutter run -d windows -v`.

使用全栈跟踪运行时,这些是错误:

#1      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:569:7)
<asynchronous suspension>
#2      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:797:18)
#3      _rootRunUnary (dart:async/zone.dart:1198:47)
#4      _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#5      _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#6      Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#7      Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#8      Future._completeWithValue (dart:async/future_impl.dart:529:5)
#9      _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:40:15)
#10     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:311:13)
#11     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#12     _rootRunUnary (dart:async/zone.dart:1198:47)
#13     _CustomZone.runUnary (dart:async/zone.dart:1100:19)
#14     _FutureListener.handleValue (dart:async/future_impl.dart:143:18)
#15     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:696:45)
#16     Future._propagateToListeners (dart:async/future_impl.dart:725:32)
#17     Future._completeWithValue (dart:async/future_impl.dart:529:5)
#18     Future._asyncCompleteWithValue.<anonymous closure> (dart:async/future_impl.dart:567:7)
#19     _rootRun (dart:async/zone.dart:1190:13)
#20     _CustomZone.run (dart:async/zone.dart:1093:19)
#21     _CustomZone.runGuarded (dart:async/zone.dart:997:7)
#22     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1037:23)
#23     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#24     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#25     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)
#26     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:169:5)

My pubspec.yaml:

name: invst_app
description: Investment app for personal use.

publish_to: 'none'

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  hidden_drawer_menu: ^1.1.2
  flutter_feather_icons: ^1.0.3
  line_awesome_icons: ^1.0.4+2

  cupertino_icons: ^0.1.3

dev_dependencies:
  flutter_test:
    sdk: flutter

flutter:

  uses-material-design: true

  assets:
    - assets/images/

不知道这里发生了什么,有人知道了吗?谢谢 :)

评论
  • wquod
    wquod 回复

    是否可以发布您的pubspec.yaml的内容?