为什么抖动的桌面嵌入会在生成时引发错误?

时间:2019-11-11 20:09:34

标签: flutter dart

我想在Windows上运行现有的flutter应用程序,因此我加载了最新的flutter-desktop-embeddding版本,将代码放入其中并尝试运行它。很快就会出现异常:

Build process failed. To view the stack trace, please run `flutter run -d windows -v`.

#0      throwToolExit (package:flutter_tools/src/base/common.dart:28:3)
#1      buildWindows (package:flutter_tools/src/windows/build_windows.dart:82:5)
<asynchronous suspension>
#2      WindowsDevice.buildForDevice (package:flutter_tools/src/windows/windows_device.dart:46:11)
#3      DesktopDevice.startApp (package:flutter_tools/src/desktop_device.dart:87:13)
<asynchronous suspension>
#4      FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:416:54)
<asynchronous suspension>
#5      HotRunner.run (package:flutter_tools/src/run_hot.dart:266:39)
<asynchronous suspension>
#6      RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:499:37)
<asynchronous suspension>
#7      FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:570:18)
#8      _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#9      _rootRunUnary (dart:async/zone.dart:1132:38)
#10     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#11     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#12     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#13     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#14     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#15     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#16     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#17     RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#18     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#19     _rootRunUnary (dart:async/zone.dart:1132:38)
#20     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#21     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#22     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#23     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#24     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#25     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:30:15)
#26     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:288:13)
#27     IosProject.isSwift (package:flutter_tools/src/project.dart)
#28     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:71:64)
#29     _rootRunUnary (dart:async/zone.dart:1132:38)
#30     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#31     _FutureListener.handleValue (dart:async/future_impl.dart:137:18)
#32     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:678:45)
#33     Future._propagateToListeners (dart:async/future_impl.dart:707:32)
#34     Future._completeWithValue (dart:async/future_impl.dart:522:5)
#35     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:552:7)
#36     _rootRun (dart:async/zone.dart:1124:13)
#37     _CustomZone.run (dart:async/zone.dart:1021:19)
#38     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#39     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#40     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#41     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#42     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:116:13)
#43     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:173:5)

我正在开发主频道,已经进行了 flutter升级,否则我认为我做了我需要做的所有其他事情。运行带有flutter-desktop-embedding的示例不会引发任何异常,而且看来,如果我将lib文件夹复制到examples文件夹中,则该应用程序将无法构建。

有人也面临这个问题吗?

1 个答案:

答案 0 :(得分:0)

此问题是由于Flutter版本可以解决的

  1. 打开终端并写入flutter upgrade --force

  2. 打开Windows Flutter项目并编写flutter run