Whenever I make a change to any flutter projects in VS Code, the hot reload feature will fail returning the message below. It also causes the app to load a white screen on the device whenever I try to start debugging.
NoSuchMethodError: The method 'update' was called on null.
Receiver: null
Tried calling: update(bundle: Instance of '_ManifestAssetBundle', bundleDirty: false, bundleFirstUpload: true, dillOutputPath: null, fileFilter: Instance of '_CompactLinkedHashSet<String>', firstBuildTime: Instance of 'DateTime', fullRestart: false, generator: Instance of 'ResidentCompiler', mainPath: "C:\\Workspace\\flutter_test_app\\lib\\main.dart", pathToReload: "C:\\Workspace\\flutter_test_app\\lib\\main.dart.incremental.dill", projectRootPath: "C:\\Workspace\\flutter_test_app", target: "lib\\main.dart")
Here is a printout of the flutter doctor -v command:
[√] Flutter (Channel beta, v0.9.4, on Microsoft Windows [Version 6.3.9600], locale en-US)
• Flutter version 0.9.4 at C:\Development\flutter
• Framework revision f37c235c32 (4 weeks ago), 2018-09-25 17:45:40 -0400
• Engine revision 74625aed32
• Dart version 2.1.0-dev.5.0.flutter-a2eb050044
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\*********\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 29.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[√] IntelliJ IDEA Ultimate Edition (version 2018.1)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.3
• Flutter plugin version 28.0.2
• Dart plugin version 181.4892.1
[√] VS Code, 64-bit edition (version 1.28.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 2.19.0
[!] Connected devices
• Device ZY223GWFRR is offline.
! Doctor found issues in 1 category.
Could you run the Dart: Capture Logs command (see https://dartcode.org/docs/logging/#capture-logs-command) and reproduce the issue, then attach or send me the log?
I've seen this issue before when hot reloads were sent before the app had finished running (https://github.com/Dart-Code/Dart-Code/issues/999) so I wonder if the startup hasn't completed properly.
I was able to reproduce the issue and attach the logs. The logs represent my attempt to launch the app using the debugger, as well as me initiating a hot reload with the restart the command.
Like before, the app opens to a white screen and the error message that I've shown you earlier appears again.
Looks like a timeout was hit at startup:
[12:58:09] [FlutterRun] [Info] <== [{"event":"app.log","params":{"appId":"f90eec13-8d77-49e1-9420-ff054f80057c","log":"timeout waiting for the application to start","error":true}}]
[12:58:09] [FlutterRun] [Info] <== [{"event":"app.started","params":{"appId":"f90eec13-8d77-49e1-9420-ff054f80057c"}}]
This particular timeout is not handled very well - it times out but then carries on, and leaves things in a bad state. There's an open issue at https://github.com/flutter/flutter/issues/22338 about it, and to try and reduce the impact of it I've increased the timeout at https://github.com/flutter/flutter/pull/22504.
Please try switching to the Flutter dev branch and see whether there's any difference (I think dev will have my change by now) and let me know.
There's also some work in progress to remove this timeout entirely which should solve the problem entirely rather than just reducing the chance of it happening.
Please try switching to the Flutter
devbranch and see whether there's any difference (I thinkdevwill have my change by now) and let me know.
Sorry I am fairly new to GitHub. How is this done?
You can change which Flutter channel you're on with the flutter channel command, for example flutter channel dev and flutter channel beta.
There's more info at https://github.com/flutter/flutter/wiki/Flutter-build-release-channels
This issue seems to be inconsistent as up until recently, running flutter with the debugger and hot reload seems to work fine. However, today I noticed the same problem and switched to the dev branch as you have suggested. Initially, it seemed that the problem was resolved. But after disconnecting my device and re-connecting it, I noticed the same problem once again.
I've attached the logs below and included the details from flutter doctor -v as well.
[√] Flutter (Channel dev, v0.10.1, on Microsoft Windows [Version 6.3.9600], locale en-US)
• Flutter version 0.10.1 at C:\Development\flutter
• Framework revision 6a3ff018b1 (9 days ago), 2018-10-18 18:38:26 -0400
• Engine revision 3860a43379
• Dart version 2.1.0-dev.7.1.flutter-b99bcfd309
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at C:\Users\******\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 29.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[√] IntelliJ IDEA Ultimate Edition (version 2018.1)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2018.1.3
• Flutter plugin version 28.0.2
• Dart plugin version 181.4892.1
[√] VS Code, 64-bit edition (version 1.28.2)
• VS Code at C:\Program Files\Microsoft VS Code
• Flutter extension version 2.19.0
[√] Connected device (1 available)
• Moto G 4 • ZY223GWFRR • android-arm • Android 7.0 (API 24)
• No issues found!
In the logs I see this:
[12:36:52 GMT-0500 (Eastern Standard Time)] [FlutterRun] [Info] <== [{"event":"app.log","params":{"appId":"0bcb5169-364e-4c12-a584-ded6ecd40c19","log":"timeout waiting for the application to start","error":true}}]
So I think this is a dupe of https://github.com/flutter/flutter/issues/22338. The problem is that the build is hitting a timeout, but it's reported in a way that makes it look like the app has finished building (though it has not).
I would expect you to see other strange things as a result of this though (such as the app remaining on a white screen when running in debug mode?). I see you already mentioned that!
Yeah, the app remaining on the white screen is definitely a result of the issue. Another strange thing about it is that if I close the app, and manually launch it from the app menu on the device, the app will start after a while with the changes that were built.
I won't be able to see any error messages though as the debugger process hangs after that step.
Yeah, launching it manually will run without the debugger so I'd expected that to work (though I don't know why it'd take a while).
The latest comment on https://github.com/flutter/flutter/issues/22338 suggests that removing the timeout may progress soon.
If you're hitting this a lot and desperate for a workaround you could try manually changing the timeout in your local Flutter install (though be aware that modifying your Flutter SDK could result in breakages - though this modification is very small). It's in packages/flutter_tools/lib/src/commands/daemon.dart:
https://github.com/flutter/flutter/commit/3ea4b44374270da230408e7a63b7ad11441d7dfe
Then delete the bin/cache/flutter_tools.snapshot folder from the Flutter SDK and the snapshot will be recreated on the next invocation of Flutter.
If you do try this, let me know if it solves the issue (there's always a chance it's hanging, rather than just taking longer than the timeout). Hopefully there will be an upstream fix soon.
Ctrl+Shift+F5
Your welcome in advance!
@Ksomething There has been a stable Flutter release since my last comment here, are you still seeing this or is it resolved?
Same issue here, Hot Reload doesn't work on VS Code anymore 😢
I've changed the title on this issue to avoid confusion. The issue reported here is different to the current issue of Hot Reload not working in VS Code 1.32. That issue is covered here:
https://github.com/Dart-Code/Dart-Code/issues/1518
This was a regression VS Code 1.32 (https://github.com/Microsoft/vscode/issues/69534) which has since been fixed but not released. I've verified the fix works building VS Code from source, and it should go into an Insiders build today. It's tagged as important and for a recovery build so I'm hoping there will be a new VS Code release this week to fix it.
In the meantime, you should downgrade to VS Code 1.31 using the download links at the top of the 1.31 release notes page or wait for today's Insiders build (due soon?) if you don't mind using that.
(The Insiders build has just gone out actually, so you can switch to that immediately - make sure it has todays date when you open the About dialog)
Thanks @DanTup, good to know that!
Confirmed that VS Code Version 1.32.3 (1.32.3) got Hot Reload back to work!
@Ksomething are you still have issues with this?
Please shout if anyone is still having an issue here on latest version of VS Code/Dart-Code/Flutter.
Most helpful comment
Same issue here, Hot Reload doesn't work on VS Code anymore 😢