-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Steps to Reproduce
I wrote an application which runs successfully on Android and iOS (in fact they are on production since some time ago).
The app is organized by packages (following clean architecture pattern), so I enabled the debugExternalPackageLibraries flag in my settings.json file to be able to debug all my code.
When I started configuring the environment to deploy web version I realized that the breakpoints which are outside the main package are not working (meanwhile they are working on Android and iOS platforms).
I mean, I am able to add a breakpoint at any file inside the main lib/ path, but if I try to add it on a package outside of this package, the Visual Studio marks it as a Unverified Breakpoint.
my_project
|
|__ lib
| |__any_file.dart (can add breakpoint) ✅
|
|_account_domain (any other package)
| any_file.dart (can't add breakpoint) ❌
I tried different combinations of the settings.json file using these flags:
"debug.allowBreakpointsEverywhere": true,
"dart.debugSdkLibraries": true,
"dart.debugExternalPackageLibraries": true,
I also tried to debug the project using Dev Tools in web browser, but in this case the tool doesn't allow to add breakpoints in external packages (the small white dot which shows that the line code admits a breakpoint does not appear at any line of any file outside the lib/ folder).
Also tried to downgrade Chrome version following this issue but still not working.
This is my launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Project Dev",
"request": "launch",
"program": "lib/main_dev.dart",
"type": "dart",
"flutterMode": "debug",
"args": [
"--flavor",
"dev",
"-t",
"lib/main_dev.dart"
]
},
{
"name": "Project Prod",
"request": "launch",
"program": "lib/main_prod.dart",
"type": "dart",
"args": [
"--flavor",
"prod",
"-t",
"lib/main_prod.dart"
]
},
{
"name": "Project (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
}
]
}
Code sample
Flutter analyze:
0 issues found. (ran in 10.6s)
Flutter doctor:
[✓] Flutter (Channel stable, 3.0.3, on macOS 12.1 21C52 darwin-arm (Rosetta), locale es-ES)
• Flutter version 3.0.3 at /Users/jugarcs/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 676cefaaff (hace 6 días), 2022-06-22 11:34:49 -0700
• Engine revision ffe7b86a1e
• Dart version 2.17.5
• DevTools version 2.12.2
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
• Android SDK at /Users/jugarcs/Library/Android/sdk
• Platform android-32, build-tools 33.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.11+0-b60-7590822)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 13.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.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 11.0.11+0-b60-7590822)
[✓] VS Code (version 1.68.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.42.0
[✓] Connected device (2 available)
• macOS (desktop) • macos • darwin-arm64 • macOS 12.1 21C52 darwin-arm (Rosetta)
• Chrome (web) • chrome • web-javascript • Google Chrome 103.0.5060.53
[✓] HTTP Host Availability
• All required HTTP hosts are available
• No issues found!