I have a very confusing behavior when I try to debug a really simple app. I just finished this tutorial, https://codelabs.developers.google.com/codelabs/first-flutter-app-pt2#8, so nothing fancy :)
What happens is, break-points are not triggered when they are defined in VSCode. I did some research, and with this topic - Dart Flutter DevTools "Debugger" Tab not showing up - was able to get the debugger tab in DevTools. Funny part is, when I define a break-point in DevTools, then the debugging itself happens in VSCode (even if no break-point).
Obviously, I'd prefer to be able to set up my break-points in VSCode. Thank you for your help!
Some more details :
[flutter] flutter doctor -v
[✓] Flutter (Channel stable, 2.2.3, on macOS 11.2.3 20D91 darwin-arm, locale fr-FR)
• Flutter version 2.2.3 at /Users/<usr>/SDK/flutter
• Framework revision f4abaa0735 (il y a 7 semaines), 2021-07-01 12:46:11 -0700
• Engine revision 241c87ad80
• Dart version 2.13.4
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
• Android SDK at /Users/<usr>/Library/Android/sdk
• Platform android-30, build-tools 30.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.5.1, Build version 12E507
• CocoaPods version 1.10.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• 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 1.8.0_242-release-1644-b3-6915495)
[✓] VS Code (version 1.58.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.25.0
[✓] Connected device (2 available)
• iPhone 12 Pro Max (mobile) • 44122881-8949-4230-9347-3EDC8484A098 • ios • com.apple.CoreSimulator.SimRuntime.iOS-14-5 (simulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 92.0.4515.159
• No issues found!
exit code 0
and the debug config in VSCode
{
"version": "0.2.0",
"configurations": [
{
"name": "flutter_application_1",
"request": "launch",
"type": "dart",
"flutterMode": "debug"
}
]
}