Skip to content

[flutter_tools] PathNotFoundException during native assets cleanup #190234

Closed

Description

@bkonyi

During native assets cleanup in _copyNativeCodeAssetsForOS, the tool iterates over the target directory and deletes files.
If a file (such as a macOS metadata ._* file or a temporary file) is deleted by the OS or another process after being listed but before the tool attempts to delete it, the tool crashes with PathNotFoundException (ENOENT).
We should use ErrorHandlingFileSystem.deleteIfExists to safely handle this race condition.

Note: This issue was identified as a top-10 crasher in the Flutter stable release version 3.44.8.

Activity

  1. self-assigned this
    on Jul 29, 2026
  2. added
    P2Important issues not at the top of the work list
    team-toolOwned by Flutter Tool team
    triaged-toolTriaged by Flutter Tool team
    on Jul 29, 2026
  3. added a commit that references this issue on Aug 4, 2026
  4. added a commit that references this issue on Aug 5, 2026
    7e85c6b
  5. github-actions commented on Aug 19, 2026

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

  6. locked as resolved and limited conversation to collaborators on Aug 19, 2026
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 listteam-toolOwned by Flutter Tool teamtriaged-toolTriaged by Flutter Tool team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions