Skip to content

Hot Reload does not update background isolate #20743

Closed

Description

@bkonyi

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.

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Aug 20, 2018
  2. zoechi commented on Dec 16, 2018

    @zoechi
    Contributor

    Similar to #18600

  3. added this to the milestone on Dec 16, 2018
  4. self-assigned this
    on Jan 30, 2019
  5. jonahwilliams commented on Mar 6, 2020

    @jonahwilliams
    Contributor

    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...
    

    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

  6. bkonyi commented on Mar 9, 2020

    @bkonyi
    ContributorAuthor

    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.

  7. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  8. removed this from the milestone on Aug 17, 2020
  9. mkustermann commented on Sep 9, 2021

    @mkustermann
    Member

    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.

  10. github-actions commented on Sep 23, 2021

    @github-actions

    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.

  11. locked as resolved and limited conversation to collaborators on Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listdependency: dartDart team may need to help ust: hot reloadReloading code during "flutter run"toolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions