Skip to content

Windows: Adding flutter_tts as a dependency crashes the application before Dart main() on some machines #640

Description

@wantroba

Flutter version

Flutter 3.44.5 • channel stable
Framework • revision f94f4fc76b
Engine • revision 83675ed276
Dart 3.12.2

flutter_tts version

4.2.5

Platform

Windows 10 x64

Problem

I found a Windows-specific issue where simply adding flutter_tts as a dependency causes the application to crash before Dart starts on one user's machine.

The plugin is never instantiated.

I do not import it.

I do not create a FlutterTts() object.

I do not call any API from the package.

The only change was adding:

flutter_tts: ^4.2.5

to pubspec.yaml.

That alone is enough to make the application crash on startup.

Symptoms

  • Steam shows the game as "Running" for a few seconds.
  • No window is ever created.
  • Dart main() is never reached.
  • A log written as the first line of main() is never created.

Windows Event Viewer reports:

Faulting module: ucrtbase.dll
Exception code: 0xc0000409

Investigation

I isolated the issue with several test builds.

Results:

  • ✅ Flutter sample application → works
  • ✅ Flutter sample + window_manager → works
  • ❌ Flutter sample + flutter_tts dependency only → crashes

Again, the plugin is not used.

It is only listed in pubspec.yaml.

Removing the dependency completely fixes the issue.

Affected machine

  • Windows 10 x64
  • Intel i5-3470
  • NVIDIA GeForce GT 640 (driver 475.14)

Unfortunately I only have one machine that reproduces this.

Question

Could something inside the Windows plugin registration or native initialization be triggering a native crash before Dart starts?

Since no Dart code executes, it appears the crash happens during native plugin registration.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions