Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hot reload doesn't work but hot restart works in Android Studio

I recently started learning Flutter. I started with Visual studio code and everything worked perfectly.

I decided to try Android Studio to check if it is smoother but I am facing an issue with Hot Reload. When I give hot reload, this is the output.

Hot reload

It shows that 1 library got reloaded but nothing changes in the emulator. However hot restart works... Hot Restart

Can someone explain what is wrong here? Thank you!

like image 972
Jerrymon Avatar asked Sep 15 '25 14:09

Jerrymon


1 Answers

Yeah, I got the answer. To use hot reload/hot restart, you need to have a stateless or stateful widget with a build method inside it. Hot reload checks for changes in the build function to make the changes. My code didn't have a stateless widget and hence it didn't work.

like image 147
Jerrymon Avatar answered Sep 18 '25 09:09

Jerrymon