Hot reload stuck after first try
Asked Answered
J

2

8

I am using vscode to developing flutter application , I don't know what is going on ! When I save project and try to hot reload just one time it's work and notification of hot reloading(Performing hot reload) remain at bottom of vscode and next hot reloading not works.

enter image description here

Vscode not throw any error or something to catch a problem so I run application with run command and after hot reload, this is it's result :

Flutter run key commands.
r Hot reload. πŸ”₯πŸ”₯πŸ”₯
R Hot restart.
h Repeat this help message.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).
An Observatory debugger and profiler on sdk gphone x86 arm is available at: http://127.0.0.1:40989/zVisdoiRRE8=/

Flutter DevTools, a Flutter debugger and profiler, on sdk gphone x86 arm is available at: http://127.0.0.1:9101?uri=http%3A%2F%2F127.0.0.1%3A40989%2FzVisdoiRRE8%3D%2F

Running with unsound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Performing hot reload...  

Now when I press r , hot reload not working .

I am using fvm and This is my sdk version :

$ flutter doctor -v
[βœ“] Flutter (Channel unknown, 2.0.6, on Linux, locale en_US.UTF-8)
    β€’ Flutter version 2.0.6 at /home/alt/fvm/versions/2.0.6
    β€’ Framework revision 1d9032c7e1 (5 weeks ago), 2021-04-29 17:37:58 -0700
    β€’ Engine revision 05e680e202
    β€’ Dart version 2.12.3

[βœ“] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    β€’ Android SDK at /mnt/SSDP/Sdk/android/
    β€’ Platform android-S, build-tools 30.0.3
    β€’ ANDROID_HOME = /mnt/SSDP/Sdk/android
    β€’ ANDROID_SDK_ROOT = /mnt/SSDP/Sdk/android/
    β€’ Java binary at: /mnt/SSDP/android-studio/jre/bin/java
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)
    β€’ All Android licenses accepted.

[βœ“] Chrome - develop for the web
    β€’ Chrome at google-chrome

[βœ“] Android Studio
    β€’ Android Studio at /mnt/SSDP/android-studio/
    β€’ Flutter plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/9212-flutter
    β€’ Dart plugin can be installed from:
      πŸ”¨ https://plugins.jetbrains.com/plugin/6351-dart
    β€’ android-studio-dir = /mnt/SSDP/android-studio/
    β€’ Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6222593)

[βœ“] VS Code (version 1.56.2)
    β€’ VS Code at /usr/share/code
    β€’ Flutter extension version 3.23.0

[βœ“] Connected device (2 available)
    β€’ Android SDK built for x86 (mobile) β€’ emulator-5554 β€’ android-x86    β€’ Android 10 (API 29)
      (emulator)
    β€’ Chrome (web)                       β€’ chrome        β€’ web-javascript β€’ Google Chrome
      91.0.4472.77

β€’ No issues found!
  • I faced this problem with Android studio too.
Jeminah answered 1/6, 2021 at 17:6 Comment(3)
did you get this working ? – Everyone
I have this problem still. – Jeminah
so what do you any alternatives ? – Everyone
R
0

I switched back to Android Studio and after a fresh install (also deleting all contents and settings of existing installation) this error disappeared.

Since I have not found "the" solution to this problem, here are some hints on how you might solve it:

Android Studio

You can try to toggle the "Scope analysis to current package" flag. That solved a similar issue for a colleague.

If this doesn't work, you can click on "View analyzer options" to open some analysis insights in your browser. Maybe you find some hint there.

Screenshot from Android Studio

Visual Studio Code

Go to settings (⌘ Command + ,) and filter by @ext:dart-code.dart-code to get many dart analyzer specific settings. You can try to access the analyzer log files to find information why it is stuck or change the "Debug Extension Backend Protocol" setting.

enter image description here

Rape answered 25/8, 2021 at 8:31 Comment(0)
L
0

If I face it I will terminate every instance of gradle and it works well. Hot reload works again. On the linux in the command line:

ps aux | grep gradle | awk '{print $2}' | xargs kill
Let answered 31/8, 2021 at 16:27 Comment(0)

© 2022 - 2024 β€” McMap. All rights reserved.