Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter Hot Reload and Hot Restart disappeared in VSCode on Flutter master branch #1859

Closed
PhilipChng opened this issue Jul 15, 2019 · 8 comments
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is bug
Milestone

Comments

@PhilipChng
Copy link

Few issues found here:

  1. Hot reload does not work on-saved
  2. Cannot find "Flutter: Hot Reload" and "Flutter: Hot Restart" command in the Command Palette.
    Screenshot 2019-07-15 at 1 23 02 PM

Flutter doctor:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.8.2-pre.33, on Mac OS X 10.14.5 18F132, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.36.1)
[✓] Connected device (3 available)

@DanTup
Copy link
Member

DanTup commented Jul 15, 2019

Hot reload does not work on-save

Do you see any output in the Debug Console like "Reloaded x of y libraries"? Can you capture a log by running the Dart: Capture Logs command from the command palette, then run your app and try a few edits/saves, then click Stop Logging on the log notification (which may have collapsed into the bell icon in the status) bar and attach the log?

Cannot find "Flutter: Hot Reload" and "Flutter: Hot Restart" command in the Command Palette.

This could happen if we didn't detect any Flutter projects in your folder. Is the Flutter project within the top 3 levels of folders in your workspace? It could also be caused if the extension fails to activate (though probably you'd notice a lot more broken if that's the case) - you can check that by opening the developer tools (Help -> Toggle Developer Tools) and checking the console.

Could you also confirm your version of the Dart extension and the Flutter extension? Thanks!

@DanTup DanTup added the awaiting info Requires more information from the customer to progress label Jul 15, 2019
@PhilipChng
Copy link
Author

PhilipChng commented Jul 15, 2019

  1. Attached log.
    Dart-Code-Log-2019-06-01 16-23-45.txt

  2. Yes, I am in the project folder because I can run the project by short-key (F5) in Mac.
    Hot-Reload and Hot-Restart both can be trigger by the following buttons:
    Screenshot 2019-07-15 at 4 30 47 PM

  3. Dart and Flutter extensions are both at 3.2.0.

I have also checked for these
Screenshot 2019-07-15 at 4 41 54 PM

@DanTup
Copy link
Member

DanTup commented Jul 15, 2019

Thanks! It looks like the Hot Reload service (reloadSources) is not being registered, and our hot-reload-on-save handler quits early if the service is not available.

@bkonyi I would expect to be fixed by flutter/flutter#35765, but I can repro this on current master. Any ideas?

@DanTup DanTup added blocked on dart / flutter Requires a change in Dart or Flutter to progress and removed awaiting info Requires more information from the customer to progress labels Jul 15, 2019
@DanTup DanTup added this to the v3.3.0 milestone Jul 15, 2019
@DanTup
Copy link
Member

DanTup commented Jul 15, 2019

@pczn0327 as an immediate workaround, if you're able to switch to the Flutter stable channel, that shouldn't have this issue (and also shouldn't be too far behind since it was updated recently).

@PhilipChng
Copy link
Author

Thanks for the help @DanTup! I look forward for v3.3.0!

@DanTup
Copy link
Member

DanTup commented Jul 15, 2019

Ok, I figured out what this is. The name of the stream changed in the VM but I haven't published an updated VS Code extension to handle it, so the current live version fails to subscribe, and therefore never sees the service registered.

It's fixed in latest code, so if you're desperate to use master, you can install one of the preview builds of v3.3 like https://github.com/Dart-Code/Dart-Code/releases/tag/v3.3.0-alpha.2.logging.2.

@DanTup DanTup added in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is bug and removed blocked on dart / flutter Requires a change in Dart or Flutter to progress labels Jul 15, 2019
@DanTup DanTup changed the title Flutter Hot Reload and Hot Restart disappeared in VSCode Flutter Hot Reload and Hot Restart disappeared in VSCode on Flutter master branch Jul 15, 2019
@DanTup DanTup modified the milestones: v3.3.0, v3.2.1 Jul 16, 2019
@DanTup
Copy link
Member

DanTup commented Jul 16, 2019

I've published a patch as v3.2.1 that contains this fix.

@sheerazam
Copy link

My issue was that I had a release apk installed on the device, and was installing debug apk. So Hot Reload option was not being shown and vs code was stuck on assemble debug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in debugger Relates to the debug adapter or process of launching a debug session in flutter Relates to running Flutter apps is bug
Projects
None yet
Development

No branches or pull requests

3 participants