Jerrymon
Jerrymon

Reputation: 159

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!

Upvotes: 4

Views: 3749

Answers (3)

Jerrymon
Jerrymon

Reputation: 159

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.

Upvotes: 4

BabC
BabC

Reputation: 1084

Try to clic this icon. I think it will force the hot reload when you change some code

enter image description here

Upvotes: 1

xfathurrahman
xfathurrahman

Reputation: 81

have you try to :

File -->> invalidate cache and restart?

Upvotes: 0

Related Questions