Flutter的VSCode热重载无法正常工作 [英] VSCode hot reload for Flutter does not work

查看:1683
本文介绍了Flutter的VSCode热重载无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在正在VSCode上,当热重载刚刚停止工作时,就在我的flutter应用程序上工作,就在我开发的中间.我完全不知道为什么会发生这种情况,过去我从来没有对此有任何疑问.如果对任何人都有用,那么我正在开发应用程序的第二页,您可以通过第一页上的路线访问该应用程序.这就是为什么热重装无法正常工作的原因吗?如果不是,那么有人可以告诉我为什么它不起作用吗?这确实很烦人,并且阻碍了我的应用程序的进度.谢谢!

I'm on VSCode right now working on my flutter application when hot reload just stops working, right in the middle of my development. I have absolutely no idea why this happens, I had no issue with this before at all in the past. If it helps anyone, I'm working on the second page of my app, which you get to via a route on the first page. Is this why hot reload isn't working? If it isn't can someone tell me why it doesn't work? This is really annoying and hindering progress on my app. Thanks!

重新启动计算机,然后重新启动调试.如果有帮助,我正在运行MacOS Mojave 10.14.2版的Macbook Pro 2015中.

Restarting my computer, and restarting the debugging. I'm on a Macbook Pro 2015 running macOS Mojave Version 10.14.2 if that helps.

实际上没有任何要显示的代码,它与代码无关.是VSCode或Flutter.

There isn't really any code to show, it's not code related. It's VSCode or Flutter.

我希望热装能够正常工作,但不能.

I expect the hot reload to work, but it doesn't.

推荐答案

如果您使用f5启动应用或从debug下拉菜单中选择start debug,则热重载将不起作用.

The hot reload doesn't work if you launch your app using f5 or select start debugging from the dropdown of debug .

但是,如果您使用Ctrl + f5启动应用程序,或从debug下拉菜单中选择不进行调试就开始运行.

But if you launch your app using Ctrl+f5 or select start without debugging from the dropdown of debug .

要解决此问题,请先使用Shift + f5关闭正在运行的调试会话.

To solve the issue first close the running debugging session using Shift+f5.

然后从菜单栏中单击调试.单击开始而不进行调试.

Then click debug from the menu bar. Click Start without debugging.

现在,热重装效果很好.

Now The Hot reload works perfectly fine.

您也可以使用终端进行热装. 只需在终端上输入: flutter run ,应用便会启动.

You can do the hot reload also using terminal. Just type: flutter run in the terminal and the app will be launched.

只需在终端中按 r ,即可初始化热重装.

just press r in the terminal and hot reload will be initialized.

这篇关于Flutter的VSCode热重载无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆