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:
- The project or Flutter SDK is located in a directory containing non-ASCII (UTF-8) characters (e.g., C:\Users\Jérôme...).
- The file path length exceeds Windows' standard
MAX_PATH limits.
- 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
- On Windows, create a user account with a non-ASCII character (e.g.,
Jérôme).
- Install Flutter SDK or clone a new Flutter project into that user's directory (e.g.,
C:\Users\Jérôme\projects\hello_world).
- Run
flutter run or flutter build apk.
- 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.
Description
The Flutter tool crashes with a
ShaderCompilerExceptionduringflutter runorflutter buildwhen compiling default Material shaders likeink_sparkle.fragandstretch_effect.frag. This ranks as the 6th most frequent crash in our crash trends.This typically occurs when:
MAX_PATHlimits.impellercfrom executing.Instead of throwing an obscure negative exit code like
-1073741819(Access Violation) or-1073740791(Stack Buffer Overrun),flutter_toolsshould validate paths proactively and provide clear, actionable instructions to the user.Steps to Reproduce
Jérôme).C:\Users\Jérôme\projects\hello_world).flutter runorflutter build apk.ShaderCompilerException: Shader compilation of "ink_sparkle.frag" failed with exit code -1073741819.Expected Behavior
flutter_toolsshould proactively identify thatimpellercis 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 unhandledShaderCompilerException.