Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter Hot Reload and Hot Restart do not always work

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...

like image 758
Milvintsiss Avatar asked Jan 25 '23 05:01

Milvintsiss


2 Answers

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...

like image 145
Milvintsiss Avatar answered Feb 12 '23 08:02

Milvintsiss


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

like image 38
SO 80 Avatar answered Feb 12 '23 09:02

SO 80