question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Attaching to running flutter process doesn't highlight source paused on

See original GitHub issue

Describe the bug When starting a flutter project using flutter run outside of vscode and then attaching the debugger inside vscode by running >Debug: Attach to Flutter on Device and pasting the URI provided by flutter, it is possible to set a breakpoint in a file and the debugger also stops the app, but it doesn’t give any information about the current state and doesn’t highlight the line that’s paused on. The problem only occurs if in vscode the flutter project is nested in subfolder. As setting the breakpoint and breaking on it works correctly, but from then on it’s pretty useless, it’s hard to figure out what’s wrong.

To Reproduce Steps to reproduce the behavior:

  1. Create a flutter project in a subfolder of the current vscode workspace (mkdir -p flutter-test/src; code flutter-test; cd flutter-test/src; flutter create .)
  2. Start the flutter app using the CLI on a connected (android) device (flutter run)
  3. Attach to the running flutter app on the connected device
  4. Set a breakpoint, ensure the corresponding code is executed
  5. Locate call stack, notice it only says “unknown source”; check code, notice it doesn’t highlight the current line when stepping;

Expected behavior Either setting the breakpoint should fail with a meaningful error message or locating the source should work not only for setting the breakpoints but also for resolving the debugged code.

Screenshots image

Versions (please complete the following information):

  • VS Code Version: 1.63.2 Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3 Date: 2022-01-19T16:00:00.869Z Electron: 13.6.7 Chromium: 91.0.4472.164 Node.js: 14.16.0 V8: 9.1.269.40-electron.0 OS: Linux x64 5.16.2-arch1-1
  • Dart extension version: v3.34.0
  • Dart/Flutter SDK version: Flutter (Channel stable, 2.5.3, on Arch Linux 5.16.2-arch1-1, locale en_US.UTF-8

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:14 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
DanTupcommented, Mar 31, 2022

Since this is different to the original issue here, let’s continue this at https://github.com/Dart-Code/Dart-Code/issues/3896.

0reactions
DanTupcommented, Aug 25, 2022

I’ve re-tested this on the current Flutter beta (v3.3.0-0.5.pre) with the latest Dart extension and dart.previewSdkDaps: true and confirmed it’s all working as expected.

The new SDK DAPs will be gradually become default over the coming months (though you can still opt-in with that flag) when you’re using a new enough SDK.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Using the debugger - Flutter documentation
When your application encounters a breakpoint, it pauses there, and the DevTools debugger shows the paused execution location in the source area.
Read more >
Flutter stuck at Installing build\app\outputs\apk\app.apk
First Install App using flutter run from terminal · When App is Installed. long press on app icon and go to app info....
Read more >
Debug a JavaScript or TypeScript app - Visual Studio (Windows)
To run your app, press F5 (Debug > Start Debugging). The debugger pauses at the breakpoint you set (IDE highlights the statement in...
Read more >
Dart DevTools
Use the dart run --observe command to execute the main file for the Dart command-line app that you want to debug or observe....
Read more >
Flutter isolates – everything you need to know | Codemagic Blog
This article is about understanding isolates in Flutter ... Then proceeds to run other lines of code /// While waiting, this does not...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found