Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flutter compiler suddenly stopped working #60389

Closed
brighttank opened this issue Mar 24, 2025 · 6 comments
Closed

Flutter compiler suddenly stopped working #60389

brighttank opened this issue Mar 24, 2025 · 6 comments
Labels
area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.

Comments

@brighttank
Copy link

Target dart2js failed: ProcessException: Process exited abnormally with exit code 253:
.dart_tool/flutter_build/2b895b047c2de07e6cc46404a9075afa/main.dart:
Internal Error: The compiler crashed when compiling this element.

The compiler is broken.

When compiling the above element, the compiler crashed. It is not
possible to tell if this is caused by a problem in your program or
not. Regardless, the compiler should not crash.

The Dart team would greatly appreciate if you would take a moment to
report this problem at http://dartbug.com/new.

Please include the following information:

  • the name and version of your operating system,

  • the Dart SDK build number (3.7.2), and

  • the entire message you see here (including the full stack trace
    below as well as the source location above).

The compiler crashed: Crash when compiling
file:///Users/andrew/Intellij/rememberit/client/modules/rememberit_web/.dart_tool/flutter_build/2b895b047c2de07e6cc46404a9075afa/main.dart:
Unexpected Kernel SDK Version f6ed8d7 (expected 9594995).

#0 BinaryBuilder._readAndVerifySdkHash (package:kernel/binary/ast_from_binary.dart:657)
#1 BinaryBuilder._verifyComponentInitialBytes (package:kernel/binary/ast_from_binary.dart:874)
#2 BinaryBuilder.readComponent. (package:kernel/binary/ast_from_binary.dart:697)
#3 Timeline.timeSync (dart:developer/timeline.dart:188)
#4 BinaryBuilder.readComponent (package:kernel/binary/ast_from_binary.dart:695)
#5 ProcessedOptions.loadComponent (package:front_end/src/base/processed_options.dart:590)
#6 ProcessedOptions.loadAdditionalDills (package:front_end/src/base/processed_options.dart:572)

#7 generateKernelInternal. (package:front_end/src/kernel_generator_impl.dart:114)

#8 withCrashReporting (package:front_end/src/base/crash.dart:139)

#9 compile. (package:front_end/src/api_unstable/dart2js.dart:166)

#10 CompilerContext.clear (package:front_end/src/base/compiler_context.dart:77)

#11 compile (package:front_end/src/api_unstable/dart2js.dart:164)

#12 _loadFromSource (package:compiler/src/phase/load_kernel.dart:372)

#13 run (package:compiler/src/phase/load_kernel.dart:486)

#14 Compiler.loadKernel (package:compiler/src/compiler.dart:428)

#15 Compiler.produceKernel (package:compiler/src/compiler.dart:437)

#16 Compiler.runSequentialPhases (package:compiler/src/compiler.dart:722)

#17 Compiler.runInternal. (package:compiler/src/compiler.dart:339)

#18 Compiler.runInternal (package:compiler/src/compiler.dart:338)

#19 Compiler.run. (package:compiler/src/compiler.dart:250)

#20 compile. (package:compiler/compiler_api.dart:273)

#21 compile.compilationDone (package:compiler/src/dart2js.dart:777)

#22 main (package:compiler/src/dart2js.dart:1327)

Command: /Users/andrew/fvm/versions/3.29.2/bin/cache/dart-sdk/bin/dart compile js
--platform-binaries=/Users/andrew/fvm/versions/3.29.2/bin/cache/flutter_web_sdk/kernel --invoker=flutter_tool -Ddart.vm.product=true
-DFLUTTER_WEB_USE_SKIA=true -DFLUTTER_WEB_USE_SKWASM=false
-DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/18b71d647a292a980abb405ac7d16fe1f0b20434/ --native-null-assertions
--no-source-maps -o /Users/andrew/Intellij/rememberit/client/modules/rememberit_web/.dart_tool/flutter_build/2b895b047c2de07e6cc46404a9075afa/app.dill
--packages=/Users/andrew/Intellij/rememberit/client/modules/rememberit_web/.dart_tool/package_config.json --cfe-only
/Users/andrew/Intellij/rememberit/client/modules/rememberit_web/.dart_tool/flutter_build/2b895b047c2de07e6cc46404a9075afa/main.dart
#0 RunResult.throwException (package:flutter_tools/src/base/process.dart:118:5)
#1 _DefaultProcessUtils.run (package:flutter_tools/src/base/process.dart:344:19)

#2 Dart2JSTarget.build (package:flutter_tools/src/build_system/targets/web.dart:201:5)

#3 _BuildInstance._invokeInternal (package:flutter_tools/src/build_system/build_system.dart:876:9)

#4 Future.wait. (dart:async/future.dart:528:21)

#5 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:814:32)

#6 Future.wait. (dart:async/future.dart:528:21)

#7 _BuildInstance.invokeTarget (package:flutter_tools/src/build_system/build_system.dart:814:32)

#8 FlutterBuildSystem.build (package:flutter_tools/src/build_system/build_system.dart:637:16)

#9 WebBuilder.buildWeb (package:flutter_tools/src/web/compile.dart:93:34)

#10 BuildWebCommand.runCommand (package:flutter_tools/src/commands/build_web.dart:253:5)

#11 FlutterCommand.run. (package:flutter_tools/src/runner/flutter_command.dart:1558:27)

#12 AppContext.run. (package:flutter_tools/src/base/context.dart:154:19)

#13 CommandRunner.runCommand (package:args/command_runner.dart:212:13)

#14 FlutterCommandRunner.runCommand. (package:flutter_tools/src/runner/flutter_command_runner.dart:496:9)

#15 AppContext.run. (package:flutter_tools/src/base/context.dart:154:19)

#16 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:431:5)

#17 run.. (package:flutter_tools/runner.dart:98:11)

#18 AppContext.run. (package:flutter_tools/src/base/context.dart:154:19)

#19 main (package:flutter_tools/executable.dart:99:3)

Compiling lib/main.dart for the Web... 441ms
Error: Failed to compile application for the Web

@brighttank
Copy link
Author

If I downgrade to flutter 3.29.0 or 3.29.1 then the problem disappears. Upgrading causes it to re-appear. I've run flutter clean but it doesn't help.

@ManuelRauber
Copy link

ManuelRauber commented Mar 27, 2025

Same issue here.

After reinstalling Flutter (via fvm), flutter clean etc. it works one time. The second compile the same error rises up.

Flutter doctor:

[✓] Flutter (Channel stable, 3.29.2, on macOS 15.3.2 24D81 darwin-arm64, locale en-GB) [435ms]
    • Flutter version 3.29.2 on channel stable at /Users/manuelrauber/fvm/versions/3.29.2
    • Upstream repository ssh://git@github.com/flutter/flutter.git
    • Framework revision c236373904 (13 days ago), 2025-03-13 16:17:06 -0400
    • Engine revision 18b71d647a
    • Dart version 3.7.2
    • DevTools version 2.42.3

Never had issues with Flutter installed via fvm so far.

@lrhn lrhn added the area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer. label Mar 27, 2025
@johnniwinther
Copy link
Member

@jensjoha Do you know how this can happen? (Also why don't we report an error instead of crashing?)

@brighttank
Copy link
Author

For reference, here's my flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.2, on macOS 14.7 23H124 darwin-arm64, locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
    ✗ cmdline-tools component is missing
      Run `path/to/sdkmanager --install "cmdline-tools;latest"`
      See https://developer.android.com/studio/command-line for more details.
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/to/macos-android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.2)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.3.1.1)
[✓] IntelliJ IDEA Community Edition (version 2024.2.3)
[✓] VS Code (version 1.96.4)
[✓] Connected device (4 available)
[✓] Network resources

! Doctor found issues in 1 category.

I've also tried deleting my local pub-cache but that didn't help either.

@jensjoha
Copy link
Contributor

From the the command:

Command: /Users/andrew/fvm/versions/3.29.2/bin/cache/dart-sdk/bin/dart compile js
--platform-binaries=/Users/andrew/fvm/versions/3.29.2/bin/cache/flutter_web_sdk/kernel --invoker=flutter_tool -Ddart.vm.product=true
-DFLUTTER_WEB_USE_SKIA=true -DFLUTTER_WEB_USE_SKWASM=false
-DFLUTTER_WEB_CANVASKIT_URL=https://www.gstatic.com/flutter-canvaskit/18b71d647a292a980abb405ac7d16fe1f0b20434/ --native-null-assertions
--no-source-maps -o /Users/andrew/Intellij/rememberit/client/modules/rememberit_web/.dart_tool/flutter_build/2b895b047c2de07e6cc46404a9075afa/app.dill
--packages=/Users/andrew/Intellij/rememberit/client/modules/rememberit_web/.dart_tool/package_config.json --cfe-only
/Users/andrew/Intellij/rememberit/client/modules/rememberit_web/.dart_tool/flutter_build/2b895b047c2de07e6cc46404a9075afa/main.dart

Specifically this part:

--platform-binaries=/Users/andrew/fvm/versions/3.29.2/bin/cache/flutter_web_sdk/kernel

and the way it's crashing I'm guessing there's been some thing wrong with the files in this folder.
Could you try to delete /Users/andrew/fvm/versions/3.29.2/bin/cache/?
That should make flutter re-download things --- unless "fvm" (which I don't know) makes it to other things.

@brighttank
Copy link
Author

Thanks, that fixed things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-dart-model For issues related to conformance to the language spec in the parser, compilers or the CLI analyzer.
Projects
None yet
Development

No branches or pull requests

5 participants