Skip to content

flutter run exits on hot reload when a build hook removes a generated asset #442

Open

Description

@bdero

Hot reload ends the flutter run session when a build hook deletes a file in flutter_scene_generated/ that the tool had already listed. The tool collects the app's assets before the hook re-runs, then fails to copy the file the hook removed, and the app exits.

Application finished.
Flutter failed to copy .../flutter_scene_generated/texture.etc1s_cooked.ed4b3bc6.ktx2 to .../flutter_assets/flutter_scene_generated/texture.etc1s_cooked.ed4b3bc6.ktx2 due to source location error. The file or directory could not be found.

Any hook run that drops or replaces an output triggers it, for example deleting a source image the hook cooks, or switching a texture's buildTextures encoding (#433), which replaces its .fstex with a .ktx2.

Steps to reproduce (seen on macOS with Metal):

  1. flutter run an app whose hook cooks a texture with buildTextures.
  2. Delete that source image and remove it from the hook's textures list.
  3. Press r.

The root cause is in the Flutter tool, which should list assets after hooks run and should not end the session over a failed asset copy. Until that's fixed upstream, we can keep a replaced output on disk for one more build so the reload that still lists it can copy it.

Once we have a minimal reproduction outside flutter_scene, we'll file an upstream Flutter issue and link it here.

Activity

  1. added
    buildProject building
    bugSomething isn't working.
    upstreamRoot cause is in Flutter / engine / Dart, not flutter_scene.
    on Sep 30, 2026
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

    bugSomething isn't working.buildProject buildingupstreamRoot cause is in Flutter / engine / Dart, not flutter_scene.

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions