Skip to content

[tool] flutter test logic to determine whether to rebuild the asset bundle may not work after upgrading flutter to a version that changes the schema of the asset manifest #128563

Closed

Description

@andrewkolos

This issue should be fixed before we make any changes to asset manifest generation.

Discovered while investigating #127297. See this comment on the issue for repro steps and an explanation.

flutter test, when deciding whether or not to build the asset bundle, checks for an existing asset manifest file (which is part of every asset bundle). If one is not found, or has a last-modified time that predates the last-modified time of pubspec.yaml, the asset bundle is rebuillt.

This logic does not account for the case where flutter changes the formatting/schema for the contents of the asset manifest. In this scenario, the image resolution code in the framework would expect the asset manifest to be in the new format. However, the pre-existing asset manifest is in the previous format. The user, when running flutter test via CLI or IDE, would then see a confusing error, similar to one encountered in #127297. The only way to resolve this is to clear the cached manifest file (e.g. using flutter clean), and it is not obvious that this is what is needed.

We should find a way to improve this logic so that we are free to update the formatting/contents of the asset manifest file in the future.

Activity

  1. added
    a: tests
    tool
    a: assets
    P2
    on Jun 9, 2023
  2. changed the title [-][tool] `flutter test` logic to determine whether to rebuild the asset bundle may not work after upgrading flutter to a version that changes the asset manifest schema is changed[/-] [+][tool] `flutter test` logic to determine whether to rebuild the asset bundle may not work after upgrading flutter to a version that changes the schema of the asset manifest[/+] on Jun 9, 2023
  3. added
    team-tool
    triaged-tool
    on Jul 8, 2023
  4. added
    tool-still-valid
    on Jul 11, 2025
  5. added a commit that references this issue on Nov 19, 2026
    e7222b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2a: assetsa: teststeam-tooltooltool-still-validtriaged-tool

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions