Skip to content

[tool_crash] ShaderCompilerException at ShaderCompiler.compileShader on Windows/Linux due to UTF-8 paths or MAX_PATH #186955

Description

@bkonyi

Description

The Flutter tool crashes with a ShaderCompilerException during flutter run or flutter build when compiling default Material shaders like ink_sparkle.frag and stretch_effect.frag. This ranks as the 6th most frequent crash in our crash trends.

This typically occurs when:

  1. The project or Flutter SDK is located in a directory containing non-ASCII (UTF-8) characters (e.g., C:\Users\Jérôme...).
  2. The file path length exceeds Windows' standard MAX_PATH limits.
  3. Antivirus/Ransomware protection locks or blocks impellerc from executing.

Instead of throwing an obscure negative exit code like -1073741819 (Access Violation) or -1073740791 (Stack Buffer Overrun), flutter_tools should validate paths proactively and provide clear, actionable instructions to the user.

Steps to Reproduce

  1. On Windows, create a user account with a non-ASCII character (e.g., Jérôme).
  2. Install Flutter SDK or clone a new Flutter project into that user's directory (e.g., C:\Users\Jérôme\projects\hello_world).
  3. Run flutter run or flutter build apk.
  4. Observe ShaderCompilerException: Shader compilation of "ink_sparkle.frag" failed with exit code -1073741819.

Expected Behavior

flutter_tools should proactively identify that impellerc is about to be executed on paths containing non-ASCII characters or exceeding path limits, and print a helpful message instructing the user to move the project to an ASCII-only path, rather than crashing with an unhandled ShaderCompilerException.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listteam-toolOwned by Flutter Tool teamtriaged-toolTriaged by Flutter Tool team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions