You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hot Reload does not update background isolate #20743
When performing a hot reload in an application which uses a plugin with background execution, the background isolate is not updated with the latest code.
What I get when running this locally is that we attempt to restart all isolates, but perhaps the Android Alarm Manager itself is blocking the restart of the background isolate:
Performing hot restart... ⣽[Isolate isolates/2476543108908847, Isolate isolates/84157653816603]
[_flutterView/0x7a7546bf20, _flutterView/0x7a7546db20]
⣟I/AlarmService(17594): AlarmService started!
Restarted application in 1,298ms.
I/flutter (17594): Rainbow Monkey has started
W/AlarmService(17594): Attempted to start a duplicate background isolate. Returning...
Yeah, I think the alarm manager plugin needs to be updated to actually check the running state of the background isolate instead of checking if the variable containing the background isolate is null or not.
As part of dart-lang/sdk#36097 we have fixed issues with hot-reload and isolates (e.g. dart-lang/sdk#36648) - all isolates are reloaded together. I suspect it also addresses this issue.
If this is still an issue for anyone on master branch, please file a new issue and CC me.
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.
Activity
zoechi commentedon Dec 16, 2018
Similar to #18600
jonahwilliams commentedon Mar 6, 2020
What I get when running this locally is that we attempt to restart all isolates, but perhaps the Android Alarm Manager itself is blocking the restart of the background isolate:
This corresponds to https://github.com/flutter/plugins/blob/e61e9d45bcaadc3e409d529d30735cb4db75c5c5/packages/android_alarm_manager/android/src/main/java/io/flutter/plugins/androidalarmmanager/AlarmService.java#L58
bkonyi commentedon Mar 9, 2020
Yeah, I think the alarm manager plugin needs to be updated to actually check the running state of the background isolate instead of checking if the variable containing the background isolate is null or not.
mkustermann commentedon Sep 9, 2021
As part of dart-lang/sdk#36097 we have fixed issues with hot-reload and isolates (e.g. dart-lang/sdk#36648) - all isolates are reloaded together. I suspect it also addresses this issue.
If this is still an issue for anyone on master branch, please file a new issue and CC me.
github-actions commentedon Sep 23, 2021
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.