Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code (OSX) Flutter hot reload is not triggered by save

After upgrading VS Code version to 1.32.1 automatic hot reloading is not triggered by saving / auto saving. It worked like a charm before.

Hot reloading still works by pressing hot reload button.

According to Flutter doctor Flutter seems OK:

Doctor summary (to see all details, run flutter doctor -v):

[✓] Flutter (Channel beta, v1.2.1, on Mac OS X 10.14.2 18C54, locale hu-HU)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)

[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)

[✓] Android Studio (version 3.2)

[✓] VS Code (version 1.32.1)

[✓] Connected device (2 available)

Do you have the same experiences? Do you have any suggestions to solve it?

like image 342
Tom Avatar asked Mar 08 '19 09:03

Tom


People also ask

How do you autosave on flutter?

3.42 and above: You can enable hot reload on autosave in the latest version by setting Flutter Hot Reload On Save to allIfDirty in your VSCode settings. v3. 41 and below: You can enable hot reload on autosave in the latest version by setting Flutter Hot Reload On Save to always in your VSCode settings.


2 Answers

I had the same problem. Currently I am using VSCode version 1.39.2.

For the hot reload to work you need to start debugging in VSCode.

As it says in the docs: "Only Flutter apps in debug mode can be hot reloaded." https://flutter.dev/docs/development/tools/hot-reload

You can find that option on the VSCode's top navigation inside Debug or with the shortcut F5.

You don't need to do flutter run on your terminal, nor even on VSCode, is just start debugging and it will launch lib/main.dart in debug mode.

If that doesn't solve the problem, try downgrading to the last version of VSCode.

like image 95
Iandra Bedin Avatar answered Sep 20 '22 23:09

Iandra Bedin


Edit: This issue has been fixed in VS Code 1.32.2 which is now live. No, it's not fixed in 1.32.2!

enter image description here

it dosn't work at all for me. I don't see neither loading icon, nor hot-reloaded changes

like image 29
korgara Avatar answered Sep 19 '22 23:09

korgara