All of a sudden hot reloading isn't working anymore for Flutter apps. Main difference/cause is probably that I got a VS Code update just now/today - 1.32.0.
(Restart works as normal).
Give thumbs up if you're affected.
(@DanTup:)
This was a regression in VS Code 1.32 and was fixed in VS Code 1.32.2
Same here. It seems that there is no active debug session within vscode. Try "Dart: Open DevTools".
Could you possibly run the Dart: Capture Logs command and tick Flutter Run and Debugger (Observatory),, then launch a debug session and try hot reload a few times (both using the restart button on the debug toolbar, as well as the command in the command palette). Then click Stop Logging on the notification (which may have collapsed into the bell in the status bar) to get the logs.
@elricym Something fishy.
Started Debugging, then once up and running -> opened Dart DevTools but always get "Dart DevTools requires an active debug session.".
@DanTup
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 2.24.0
Flutter extension: 2.24.0 (not activated)
VS Code: 1.32.0
Platform: mac
Workspace type: Flutter
Multi-root?: false
Dart SDK:
Loc: /Users/zarko/flutter/bin/cache/dart-sdk
Ver: 2.2.0-edge.0a7dcf17eb5f2450480527d6ad1e201fb47f1e36
Flutter SDK:
Loc: /Users/zarko/flutter
Ver: 1.2.1
HTTP_PROXY: undefined
NO_PROXY: undefined
Thu Mar 07 2019 [22:56:21 GMT+0100 (CET)] Log file started
[22:56:32 GMT+0100 (CET)] [General] [Info] Starting debug session...
[22:56:32 GMT+0100 (CET)] [General] [Info] workspace: /Users/zarko/repos/int/go-app
[22:56:32 GMT+0100 (CET)] [General] [Info] Using found common entry point: /Users/zarko/repos/int/go-app/lib/main.dart
[22:56:32 GMT+0100 (CET)] [General] [Info] Using workspace as cwd: /Users/zarko/repos/int/go-app
[22:56:32 GMT+0100 (CET)] [General] [Info] Detected launch project as Flutter
[22:56:32 GMT+0100 (CET)] [General] [Info] Using Flutter debug adapter for this session
[22:56:32 GMT+0100 (CET)] [General] [Info] Checking for errors before launching
[22:56:32 GMT+0100 (CET)] [General] [Info] Debug session starting...
{
"name": "Flutter",
"request": "launch",
"type": "dart",
"program": "/Users/zarko/repos/int/go-app/lib/main.dart",
"cwd": "/Users/zarko/repos/int/go-app",
"args": [],
"vmAdditionalArgs": [],
"dartPath": "/Users/zarko/flutter/bin/cache/dart-sdk/bin/dart",
"maxLogLineLength": 2000,
"pubPath": "/Users/zarko/flutter/bin/cache/dart-sdk/bin/pub",
"pubSnapshotPath": "/Users/zarko/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot",
"debugSdkLibraries": false,
"debugExternalLibraries": false,
"flutterDebuggerRestartBehaviour": "hotReload",
"evaluateGettersInDebugViews": true,
"forceFlutterVerboseMode": true,
"flutterTrackWidgetCreation": true,
"flutterMode": "debug",
"flutterPath": "/Users/zarko/flutter/bin/flutter",
"deviceId": "657C93E8-8BAD-4398-A5B2-7E8282511905",
"deviceName": "iPhone XR (ios)",
"showMemoryUsage": false,
"debugServer": 60616
}
Thu Mar 07 2019 [22:57:24 GMT+0100 (CET)] Log file ended
[+7600 ms] Refreshing active FlutterViews before reloading.
[ ] Sending to VM service: _flutter.listViews({})
[ +3 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0x7f9a5e809618, isolate: {type: @Isolate, fixedId: true, id: isolates/819541113, name: main.dart$main-819541113, number: 819541113}}]}
[ +375 ms] DevFS: Starting sync from LocalDirectory: '/Users/zarko/repos/int/go-app'
[ ] Scanning project files
[ +1 ms] Scanning package files
[ +73 ms] Scanning asset files
[ +1 ms] Scanning for deleted files
[ +4 ms] Compiling dart to kernel with 1 updated files
[ +57 ms] Updating files
[ +11 ms] DevFS: Sync finished
[ ] Synced 0.0MB.
[ ] Sending to VM service: _reloadSources({pause: true, rootLibUri: file:///Users/zarko/Library/Developer/CoreSimulator/Devices/657C93E8-8BAD-4398-A5B2-7E8282511905/data/Containers/Data/Application/9122E288-20A7-459C-BF8B-A361AD0FFE25/tmp/go-appVAliH7/go-app/lib/main.dart.incremental.dill, packagesUri: file:///Users/zarko/Library/Developer/CoreSimulator/Devices/657C93E8-8BAD-4398-A5B2-7E8282511905/data/Containers/Data/Application/9122E288-20A7-459C-BF8B-A361AD0FFE25/tmp/go-appVAliH7/go-app/.packages, isolateId: isolates/819541113})
[ +35 ms] Result: {type: ReloadReport, success: true, details: {finalLibraryCount: 546, receivedLibraryCount: 4, receivedLibrariesBytes: 27448, receivedClassesCount: 16, receivedProceduresCount: 8, savedLibraryCount: 542, loadedLibraryCount: 4, shapeChangeMappings:...
[ ] reloaded 4 of 546 libraries
[ ] Sending reload events to iPhone XR
[ ] Sending reload event to "main.dart$main-819541113"
[ ] Sending to VM service: getIsolate({isolateId: isolates/819541113})
[ +7 ms] Result: {type: Isolate, fixedId: true, id: isolates/819541113, name: main.dart:main(), number: 819541113, _originNumber: 819541113, startTime: 1551995805138, _heaps: {new: {type: HeapSpace, name: new, vmName: Scavenger, collections: 4, avgCollectionPeriod...
[ +2 ms] Sending to VM service: _flutter.listViews({})
[ +1 ms] Result: {type: FlutterViewList, views: [{type: FlutterView, id: _flutterView/0x7f9a5e809618, isolate: {type: @Isolate, fixedId: true, id: isolates/819541113, name: main.dart$main-819541113, number: 819541113}}]}
[ ] Evicting dirty assets
[ ] Reassembling application
[ ] Sending to VM service: ext.flutter.reassemble({isolateId: isolates/819541113})
[ +74 ms] Result: {type: _extensionType, method: ext.flutter.reassemble}
[ ] Sending to VM service: ext.ui.window.scheduleFrame({isolateId: isolates/819541113})
[ +3 ms] Result: {type: Success}
[ +1 ms] Hot reload performed in 656ms.
[ ] Reloaded 4 of 546 libraries in 660ms.
[+46222 ms] DevFS: Deleting filesystem on the device (file:///Users/zarko/Library/Developer/CoreSimulator/Devices/657C93E8-8BAD-4398-A5B2-7E8282511905/data/Containers/Data/Application/9122E288-20A7-459C-BF8B-A361AD0FFE25/tmp/go-appVAliH7/go-app/)
[ +1 ms] Sending to VM service: _deleteDevFS({fsName: go-app})
[ +8 ms] Result: {type: Success}
[ ] DevFS: Deleted filesystem on the device (file:///Users/zarko/Library/Developer/CoreSimulator/Devices/657C93E8-8BAD-4398-A5B2-7E8282511905/data/Containers/Data/Application/9122E288-20A7-459C-BF8B-A361AD0FFE25/tmp/go-appVAliH7/go-app/)
[ +1 ms] Sending to VM service: ext.flutter.exit({isolateId: isolates/819541113})
[ +25 ms] Service protocol connection closed.
[ +501 ms] Application finished.
@DanTup
Dart Code extension: 2.24.0
Flutter extension: 2.24.0 (not activated)
VS Code: 1.32.0
Platform: mac
Workspace type: Flutter
Multi-root?: false
Dart SDK:
Loc: /Users/ming/Development/flutter/bin/cache/dart-sdk
Ver: 2.2.0-edge.0a7dcf17eb5f2450480527d6ad1e201fb47f1e36
Flutter SDK:
Loc: /Users/ming/Development/flutter
Ver: 1.2.1
HTTP_PROXY: undefined
NO_PROXY: undefined
TBH, there is nothing captured after I started debug. Flutter extension: 2.24.0 (not activated) is the weirdest thing here.
I just started the same issue, and when I tried what @elricym said, to run "Dart: Open DevTools", I got a popup saying that an active debug session doesn't exist. I'm wondering if the previous version would work, but Visual Studio Code is being stupid and won't let me downgrade back to it.
@DanTup bellow is my logs. I hope you figure this out soon, it has become quite the annoyance.
Dart Code extension: 2.24.0
Flutter extension: 2.23.1 (not activated)
VS Code: 1.32.0
Platform: mac
Workspace type: Flutter
Multi-root?: false
Dart SDK:
Loc: /usr/local/flutter/bin/cache/dart-sdk
Ver: 2.2.0-edge.0a7dcf17eb5f2450480527d6ad1e201fb47f1e36
Flutter SDK:
Loc: /usr/local/flutter
Ver: 1.2.1
HTTP_PROXY: undefined
NO_PROXY: undefined
Thu Mar 07 2019 [17:47:50 GMT-0600 (CST)] Log file started
[17:47:53 GMT-0600 (CST)] [General] [Info] Starting debug session...
[17:47:53 GMT-0600 (CST)] [General] [Info] workspace: /Users/odonckers/Dropbox/knockknock
[17:47:53 GMT-0600 (CST)] [General] [Info] Using found common entry point: /Users/odonckers/Dropbox/knockknock/lib/main.dart
[17:47:53 GMT-0600 (CST)] [General] [Info] Using workspace as cwd: /Users/odonckers/Dropbox/knockknock
[17:47:53 GMT-0600 (CST)] [General] [Info] Detected launch project as Flutter
[17:47:53 GMT-0600 (CST)] [General] [Info] Using Flutter debug adapter for this session
[17:47:53 GMT-0600 (CST)] [General] [Info] Checking for errors before launching
[17:47:53 GMT-0600 (CST)] [General] [Info] Debug session starting...
{
"program": "/Users/odonckers/Dropbox/knockknock/lib/main.dart",
"cwd": "/Users/odonckers/Dropbox/knockknock",
"name": "Dart & Flutter",
"type": "dart",
"request": "launch",
"args": [],
"vmAdditionalArgs": [],
"dartPath": "/usr/local/flutter/bin/cache/dart-sdk/bin/dart",
"maxLogLineLength": 2000,
"pubPath": "/usr/local/flutter/bin/cache/dart-sdk/bin/pub",
"pubSnapshotPath": "/usr/local/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot",
"debugSdkLibraries": false,
"debugExternalLibraries": false,
"flutterDebuggerRestartBehaviour": "hotReload",
"evaluateGettersInDebugViews": true,
"forceFlutterVerboseMode": true,
"flutterTrackWidgetCreation": true,
"flutterMode": "debug",
"flutterPath": "/usr/local/flutter/bin/flutter",
"deviceId": "5F31C064-299E-4E14-83E7-7B3F535FC8DC",
"deviceName": "iPhone Xs (ios)",
"showMemoryUsage": false,
"debugServer": 50702
}
Hot reload works with the VSCode 1.31.0, so the issue should be related to some changes in vscode, not in the plugin itself.
@DanTup
I'm experiencing hot reload issues too. And I just updated my VS Code this morning to 1.32.1.
In my case, after changed some properties passed to a widget constructor, manually trigger a hot reload does reflect the changes on the device. But after making changes to a dart file and save it, no automatically reload happens at all.
Here's the log I captured:
Dart Code extension: 2.24.0
Flutter extension: 2.24.0 (not activated)
VS Code: 1.32.1
Platform: mac
Workspace type: Flutter
Multi-root?: false
Dart SDK:
Loc: /SDK_DIRECTORY/bin/cache/dart-sdk
Ver: 2.2.0-edge.0a7dcf17eb5f2450480527d6ad1e201fb47f1e36
Flutter SDK:
Loc: /SDK_DIRECTORY
Ver: 1.2.1
HTTP_PROXY: undefined
NO_PROXY: undefined
Fri Mar 08 2019 [14:03:32 GMT+0800 (CST)] Log file started
[14:03:35 GMT+0800 (CST)] [General] [Info] Starting debug session...
[14:03:35 GMT+0800 (CST)] [General] [Info] workspace: /DEV_DIRECTORY
[14:03:35 GMT+0800 (CST)] [General] [Info] Using found common entry point: /DEV_DIRECTORY/sample/lib/main.dart
[14:03:35 GMT+0800 (CST)] [General] [Info] Using workspace as cwd: /DEV_DIRECTORY
[14:03:35 GMT+0800 (CST)] [General] [Info] Found better project root to use as cwd: /DEV_DIRECTORY/sample
[14:03:35 GMT+0800 (CST)] [General] [Info] Detected launch project as Flutter
[14:03:35 GMT+0800 (CST)] [General] [Info] Using Flutter debug adapter for this session
[14:03:35 GMT+0800 (CST)] [General] [Info] Checking for errors before launching
[14:03:35 GMT+0800 (CST)] [General] [Info] Debug session starting...
{
"program": "/DEV_DIRECTORY/sample/lib/main.dart",
"cwd": "/DEV_DIRECTORY/sample",
"name": "Dart & Flutter",
"type": "dart",
"request": "launch",
"args": [],
"vmAdditionalArgs": [],
"dartPath": "/SDK_DIRECTORY/bin/cache/dart-sdk/bin/dart",
"maxLogLineLength": 2000,
"pubPath": "/SDK_DIRECTORY/bin/cache/dart-sdk/bin/pub",
"pubSnapshotPath": "/SDK_DIRECTORY/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot",
"debugSdkLibraries": false,
"debugExternalLibraries": false,
"flutterDebuggerRestartBehaviour": "hotReload",
"evaluateGettersInDebugViews": true,
"forceFlutterVerboseMode": true,
"flutterTrackWidgetCreation": true,
"flutterMode": "debug",
"flutterPath": "/SDK_DIRECTORY/bin/flutter",
"deviceId": "-",
"deviceName": "-",
"showMemoryUsage": false,
"debugServer": 50876
}
Fri Mar 08 2019 [14:04:44 GMT+0800 (CST)] Log file ended
And I'm also seeing that dart devtools notification:

Facing this issue after updating Vscode

[✓] Flutter (Channel dev, v1.3.8, on Mac OS X 10.14.3 18D109, locale en-IN)
• Flutter version 1.3.8 at /Users/rajeshkumar/Desktop/flutter
• Framework revision e5b1ed7a7f (33 hours ago), 2019-03-06 14:23:37 -0800
• Engine revision f4951df193
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/rajeshkumar/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = /Users/rajeshkumar/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 1.9.4
• CocoaPods version 1.5.0
[✓] Android Studio (version 3.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 33.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
[✓] IntelliJ IDEA Community Edition (version 2017.3.5)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 25.0.1
• Dart plugin version 173.4700
[✓] VS Code (version 1.32.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.24.0
[✓] Connected device (1 available)
• HighPeaksw iPhone X • 76fd22d0d6fe8432a90a895351b60bd1d159e8ef • ios • iOS 12.1.4
• No issues found!
Cmd + Shift + Flutter: Hot restart Cmd + Shift + Flutter: Hot reload doesn't work
Capture logs
!! PLEASE REVIEW THIS LOG FOR SENSITIVE INFORMATION BEFORE SHARING !!
Dart Code extension: 2.24.0
Flutter extension: 2.24.0 (not activated)
VS Code: 1.32.1
Platform: mac
Workspace type: Flutter
Multi-root?: false
Dart SDK:
Loc: /Users/rajeshkumar/Desktop/flutter/bin/cache/dart-sdk
Ver: 2.2.1-edge.571ea80e1101e706980ea8aefa7fc18a0c8ba2ec
Flutter SDK:
Loc: /Users/rajeshkumar/Desktop/flutter
Ver: 1.3.8
HTTP_PROXY: undefined
NO_PROXY: undefined
Fri Mar 08 2019 [12:39:37 GMT+0530 (IST)] Log file started
[12:39:37 GMT+0530 (IST)] [Analyzer] [Info] ==> {"id":"425","method":"analysis.setPriorityFiles","params":{"files":[]},"clientRequestTime":1552028977194}
[12:39:37 GMT+0530 (IST)] [Analyzer] [Info] <== {"id":"425"}
Fri Mar 08 2019 [12:39:44 GMT+0530 (IST)] Log file ended
Thanks for the info. I believe this is a bug I raised against VS Code during Insiders -> https://github.com/Microsoft/vscode/issues/69534 I didn't notice at the time it had broken hot reload, but I do believe now the issues are related. There is an event vs.debug.onDidStartDebugSession that fires at the start of a debug session that we used to track sessions (required for hot reload and a few other things), however it's not firing anymore, and I suspect it's related to "undefined session received in acceptDebugSessionStarted" appearing in the dev console.
Please put a 👍 on that issue, and I'll see if I can find any workarounds. If you have the option, I would recommend downgrading VS Code until we know how to fix.
I couldn't see the loading indicator as well in case you guys want to roll back to 1.31 heres the link https://code.visualstudio.com/updates/v1_31
The issue has been tracked down in VS Code and a fix landed. It's marked as a candidate for a recovery build. I'll close this issue once an update with the fix is released (in the meantime, stick on v1.31).
The Insiders build with this fix has gone out, so if you don't mind using VS Code Insiders, you can have 1.32 features without it breaking Flutter debugging :-)
Thanks @DanTup 👏
I can confirm VS Code Insiders 1.33.0 solves this issue.
Yes, it's working in VS Code Insiders 1.33.0 and not in VS Code 1.32.1.
VSC 1.32.2 has just been released and this error is fixed. Automatic hot reload on save works again, as do the dart devtools and all other flutter commands (toggle debug painting, etc).
I believe this issue can/should be closed.
confirming, vscode 1.32.2 fixed this issue.
confirming that vscode 1.32.2 fixed this issue.
Yep, this is all good now. Thanks! 👍
VSC 1.32.3 was just released, and it breaks hot reload. So, it looks like we regressed again.
Sorry if this is a newbie question, but how to I manually downgrade to VSC 1.31?
Thanks a lot!! Works again with latest version.
Thanks a lot!! Works again with latest version.
Which version are you using? I was just on 1.32.3 and it's not working, but it is working with the Insider's build.
@thavlik Can you confirm exactly the behaviour you're seeing, and whether you're seeing "undefined session received in acceptDebugSessionStarted" in the developer console (Help -> Toggle Developer Tools).
@DanTup Am on 1.32.3 and can confirm that its not working for me either. Checked the dev console and there is no "undefined session received in acceptDebugSessionStarted"
I am going to switch back to 1.31.x.
@sutharsha Can you try reproducing the issue, and then when you hit it, run the "Open Dev Tools" command see whether it a) works or b) complains there is no debug session?
Could you also capture a log (using Dart: Capture Logs with Flutter Run and Observatory ticked)?
Also - before you edited your message, you said you say a reload message in the debug console - is that accurate? If so, it's probably not VS Code related but a Flutter issue (in which case, rolling VS Code back might not help). If that is the case, please also capture a log as above, but open a new issue with it instead, and I'll take a look.
@DanTup I had uninstalled and went back to 1.31.1. Updated it back to current 1.32.3. Now unable to reproduce the issue. Hot reload works for now :/.
And yes i did get the reload message then.
Sure, If i get it again ll open an issue in flutter.
Yeah, if you did see the reload message, then it's definitely not this issue, since the reload message comes from Flutter but the VS Code issue meant the hot reload was never really executed.
There is an open issue at https://github.com/flutter/flutter/issues/29121 with some reports of hot reload not working correctly (it says it reloaded, but doesn't reflect changes), however some users were making changes in their main method so it's not entirely clear if there's a bug of people just hitting hot reloads limitations.
@DanTup It is gone again.
Vscode 1.33.1
1.33.1 has been out a while, though I did publish a new extension (v3.0) yesterday.
@atilkan can you open a new issue with a description of exactly what you see, including a log started prior to launching the app.
Thanks!
For all it's worth, starting/hot reloading/etc is still working as intended with VSC 1.33.1 and extension v3.0 on my end. The previous bug was widespread and would happen for everyone. So any potential new bug would be unrelated to this issue as reported.
Most helpful comment
The issue has been tracked down in VS Code and a fix landed. It's marked as a candidate for a recovery build. I'll close this issue once an update with the fix is released (in the meantime, stick on v1.31).