Dart-Code: Flutter app freezes after adding a breakpoint in VS Code

Describe the bug Running an iOS or MacOS app from VSCode, as soon as I add a breakpoint the app freezes immediately. Not hot reload or hot restart is able to revive the app. Only stopping and starting again works.

To Reproduce Steps to reproduce the behavior:

  1. Start debugging an iOS or MacOS Flutter app
  2. On VS Code, add a breakpoint at any line in your code
  3. App will freeze

Unfortunately I have noticed some intermittent behavior, but I’d say 90% of the times it freezes.

Expected behavior App should not freeze.

Screenshots If applicable, add screenshots to help explain your problem.

Please complete the following information:

You can run the Dart: Collect Diagnostic Information command from the VS Code command palette (F1) to easily capture this information or provide it manually.

Workspace Environment
Dart Code extension: 3.80.0
Flutter extension: 3.80.0 (activated)

App: Visual Studio Code
App Host: desktop
Version: mac 1.85.1

Workspace type: Dart, Flutter (LSP)

Dart (3.2.3): /Users/user/Development/flutter/bin/cache/dart-sdk
Flutter (3.16.5): /Users/user/Development/flutter (iPhone 15 (ios/ios))

Output from 'dart info'

/Users/user/Development/flutter/bin/cache/dart-sdk/bin/dart info

If providing this information as part of reporting a bug, please review the information below to ensure it only contains things you’re comfortable posting publicly.

General info

  • Dart 3.2.3 (stable) (Tue Dec 5 17:58:33 2023 +0000) on “macos_arm64”
  • on macos / Version 13.5.2 (Build 22G91)
  • locale is en-US

Project info

  • sdk constraint: ‘>=3.0.0 <4.0.0’
  • dependencies: collection
  • dev_dependencies: build_runner
  • elided dependencies: 4

Process info

Memory CPU Elapsed time Command line
10 MB 0.0% 21:53:49 dart devtools --machine --allow-embedding
448 MB 0.0% 21:53:49 dart language-server --protocol=lsp --client-id=VS-Code --client-version=3.80.0
6 MB 0.0% 18:05:18 dart run build_runner watch --delete-conflicting-outputs
29 MB 0.0% 21:53:49 flutter_tools.snapshot daemon
105 MB 0.0% 04:04 flutter_tools.snapshot debug_adapter
158 MB 2.1% 04:04 flutter_tools.snapshot run --machine --start-paused -d 00008130-000C75382E08001C --devtools-server-address http:<path>/ --target <path>/main.dart --device-timeout 10
509 MB 0.0% 03:50 frontend_server.dart.snapshot --sdk-root <path>/ --incremental --target=flutter --experimental-emit-debug-metadata -DFLUTTER_WEB_AUTO_DETECT=true -DFLUTTER_WEB_CANVASKIT_URL=https:<path>/ --output-dill <path>/app.dill --packages <path>/package_config.json -Ddart.vm.profile=false -Ddart.vm.product=false --enable-asserts --track-widget-creation --filesystem-scheme org-dartlang-root --initialize-from-dill build/dd704641fca0f13458e044aee43be5d8.cache.dill.track.dill --source file:<path>/dart_plugin_registrant.dart --source package:flutter<path>/dart_plugin_registrant.dart -Dflutter.dart_plugin_registrant=file:<path>/dart_plugin_registrant.dart --verbosity=error --enable-experiment=alternative-invalidation-strategy
Output from 'flutter doctor'

/Users/user/Development/flutter/bin/flutter doctor -v

[✓] Flutter (Channel stable, 3.16.5, on macOS 13.5.2 22G91 darwin-arm64, locale en-US)
    • Flutter version 3.16.5 on channel stable at /Users/user/Development/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 78666c8dc5 (3 weeks ago), 2023-12-19 16:14:14 -0800
    • Engine revision 3f3e560236
    • Dart version 3.2.3
    • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/user/Library/Android/sdk
    • Platform android-34, build-tools 34.0.0
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694)

[✓] VS Code (version 1.85.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.80.0

[✓] Network resources
    • All expected network resources are available.

• No issues found!

About this issue

  • Original URL
  • State: closed
  • Created 6 months ago
  • Reactions: 6
  • Comments: 21 (12 by maintainers)

Most upvoted comments

Looks like the fix has made it to the Flutter stable channel. Please run flutter upgrade and ensure you get 3.16.9 and let me know if you’re still seeing the issue.

This issue has been fixed via https://github.com/dart-lang/sdk/issues/54650 and there are hotfix requests open at https://github.com/dart-lang/sdk/issues/54699 so the fix will hopefully turn up in a stable release in the near future.

@QCIPaulCardno seems like the issue is understood now (see https://github.com/dart-lang/sdk/issues/54650#issuecomment-1898988501). Thank you for your help with getting to a repro 😃

This happens with me, over the last month, on all my projects.

As soon as I add a break point it freezes and I cannot interact with the programme I am debugging at all and have to stop and re run it. No error, no indication of what is causing it, just freezes. Causing serious delays on my projects freezing on every breakpoint.

What can I do to help?

Flutter 3.16.7 • channel stable • https://github.com/flutter/flutter.git Framework • revision ef1af02aea (3 days ago) • 2024-01-11 15:19:26 -0600 Engine • revision 4a585b7929 Tools • Dart 3.2.4 • DevTools 2.28.5 Visual Studio Code Version: 1.85.1 (Universal)

Are any of you guys using the Supabase package? I have this in common between my projects that are freezing. If not, let me know so I can count it out please.