6

For now one week, sometimes when I HotReload my changes are not applied (the log says it's been HotReload but in fact, they are not) and the same when I HotRestart so I'm forced to stop and re-run the app (and sometimes to delete the build)!

    Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel beta, v1.15.17, on Microsoft Windows [version 10.0.17763.1098], locale fr-FR)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Chrome - develop for the web
[√] Android Studio (version 3.6)
[√] Connected device (3 available)

• No issues found!

I run my app on Android Emulator 9 Pie.

EDIT: I tried to invalidate the cache of AndroidStudio and restart, and also tried on another emulator but it didn't solve the issue...

nvoigt
  • 75,013
  • 26
  • 93
  • 142
Milvintsiss
  • 1,420
  • 1
  • 18
  • 34
  • 1
    This may be tricky because of the hot reload may depend on the context. For instance, if you have a listen over a stream in the initState of a State class, the initState is not called again on hot reload. For the hot restart, I never have problems, so I can not help there. – Ricardo Markiewicz Mar 27 '20 at 20:01
  • This sounds more like an IDE issue? Which one you use and what OS? – i6x86 Mar 28 '20 at 03:07
  • all is in my Flutter Doctor Log, I'm on windows and I use Android Studio – Milvintsiss Mar 28 '20 at 03:23
  • if you add new dependencies into yaml file, then hot reload/restart will not work. You should stop and run the project again. Otheriwise hot restart will work for all scanario and hot reload will work for build method changes and non static pure dart changes. – Darish Mar 30 '20 at 06:51
  • had you tried hot reloading or hot restarting after `flutter clean` and yeah I guess you are working with flutter web which is in beta at the moment which might be the problem. – The Chinky Sight Mar 30 '20 at 10:39
  • @Darish oh yes it should but as I sayd it don't. – Milvintsiss Mar 30 '20 at 19:33
  • @ChinkySight a flutter clean will not change anything to HotReload or Restart because Flutter clean delete the build and the principle of HotRestart/Reload is to do not rebuild the project to gain time... The fact Flutter Web is in Beta was a good idea but I removed the Web support and the issue still here :( – Milvintsiss Mar 30 '20 at 19:37
  • Does this happen for all your projects or just one? Have you tried to create a project from scratch, with nothing in there and test? – Michel Feinstein Mar 31 '20 at 04:51

6 Answers6

8

My problem was a bad import

import 'file:///C:/Users/plest/StudioProjects/the_spot/lib/pages/home_page/Map/map.dart' ;

instead of

import 'package:the_spot/pages/home_page/Map/map.dart' ;

I don't know why the import changed by itself...

Milvintsiss
  • 1,420
  • 1
  • 18
  • 34
1

try changing your channel, for example run flutter channel master . worked for me

SO 80
  • 197
  • 2
  • 11
  • 1
    It's working for me with below scenario, once change the channel, also check your version also. If it is old just upgrade your flutter version. >$flutter upgrade – Saravanan S Dec 01 '21 at 16:13
  • Not working for me. I also run flutter upgrade. – Deven Feb 22 '23 at 16:32
0

uninstall & after re-install flutter plugin from setting will make this right

0

After installation. I rebooted my mac and suddenly it was way faster!

tbrodbeck
  • 460
  • 1
  • 8
  • 16
0

It could be a proxy problem. Please try to close it.

Edison xu
  • 1
  • 2
0

I was having same problem, after trying long time then realised that it was happening because I named my project using arabic characters. Changed back to english named folder and the reload worked like a charm..