Skip to content

Hot reload doesn't update assets #7302

Closed

Description

@Hixie

I added an image to my flutter.yaml and hot reloaded, but the image didn't show. I did a full restart and it worked.

cc @johnmccutchan

Activity

  1. added this to the milestone on Feb 27, 2017
  2. johnmccutchan commented on Apr 20, 2017

    @johnmccutchan
    Contributor

    The issue here is:

    When the application first boots it is using assets and script sources pulled from the APK/IPA installation directory. When we reload we switch to script sources from a temporary directory but not the assets. On a hot-restart we also switch the asset directory.

    To fix this:

    1. Add a new service protocol RPC that tells the engine to look in a specific directory for assets. This is mostly implemented today by the existing _flutter.runInView RPC which takes an assetDirectory parameter.
    2. Send this RPC after the first reload.
    3. Make sure that any cached assets are evicted.
  3. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on May 23, 2017
  4. a-siva commented on Sep 28, 2017

    @a-siva
    Contributor

    @aam does this change with the new incremental kernel generator implementation? Since the sources are not pushed we should be able to switch to the assets directory right.

  5. aam commented on Nov 3, 2017

    @aam
    Member

    I don't think it changes with IKG. We still want to explicitly switch assets directory on hot reload by sending an RPC request(_flutter.setAssetDirectory , for example?) to flutter engine. Currently, only RPC request that is sent on hot reload is to _reloadSources to Dart VM to pick up updated sources(or incremental kernel file).

  6. aam commented on Nov 3, 2017

    @aam
    Member

    This can be address with #12872 and flutter-team-archive/engine#4323

  7. Hixie commented on Dec 20, 2017

    @Hixie
    ContributorAuthor

    Leaving in current milestone since "make hot reload trustworthy" is a priority.

  8. github-actions commented on Sep 4, 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.

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

Metadata

Metadata

Assignees

Labels

c: new featureNothing broken; request for a new capabilityt: hot reloadReloading code during "flutter run"toolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions