0

On the first compile the project is build correctly and running on both device or simulator. After that if I apply a change on the code and try the Hot Restart and rebuild the app doesn't rebuild and does not show the new modification.

Even if I try flutter clean in order to clean the solution, Deleting the 'build/' path and flutter run after but the same issue occurs again.

Or rm -rf build && flutter run

I've updated both the Visual Studio Code and Flutter (version 1.9) in order to be up to date retry but does not make any change at all.

I have tried to run the app from Xcode too after flutter clean and get the same issue.

Below I'm attaching a simple print screen in order to show a simple change I've applied on a demo project on the title string value and the solution on the simulator (the same one I get on physical device too) with the code modification, and the app that doesn't rebuild.

enter image description here

P.s: I've check this one too https://github.com/flutter/flutter/issues/17155

And this one https://github.com/flutter/flutter/issues/18736 deleting files in ios/ and android/, running flutter clean, flutter create . in order to recreate the files and at the end flutter run

nike
  • 715
  • 2
  • 8
  • 14

1 Answers1

3

In your screenshot, the main.dart file appears to be unsaved (it has a dot in the tab). If the changes aren't saved, reloading in the terminal won't apply those changes.

That said, there is a much better way than running flutter run from the Terminal - use F5 (or Debug -> Start Debugging). When running that way, not only to you get a full debugger, you will get hot-reload-on-save as well as other debug functionality and easy access to DevTools!

There's more info on running and debugging in VS Code here:

https://flutter.dev/docs/development/tools/vs-code#running-and-debugging

Danny Tuppeny
  • 40,147
  • 24
  • 151
  • 275