You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Default/automatic launch configs is missing/incorrect if project is nested inside a folder #2365
i keep on having this problem : Your launch config references a program that does not exist. If you have problems launching, check the "program" field in your ".vscode/launch.json" file.
On Sat, Apr 18, 2020 at 9:19 PM Danny Tuppeny ***@***.***> wrote:
Can you try:
- Run the *Dart: Capture Logs* command (untick Analysis Server, but
leave everything else ticked)
- Try to run your app
- Click *Cancel* on the logging prompt to stop logging and open the
log file
- Attach the log file here (make sure there's nothing sensitive in it
first)
Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2365 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOXXRW5YEHCWJG75BFEF2PTRNGZF5ANCNFSM4MLLZCBA>
.
Open the VS Code command palette by pressing Ctrl+Shift+P (or on macOS, Cmd+Shift+P)
Type "capture logs" to filter the command list, and select the Dart: Capture Logs option
Untick Analysis Server (those logs aren't relevant here) and click OK
This will start capturing logs from the extension (a notification will be shown in the bottom right corner that they're being captured).
Try to launch your app so that you get the original error message from above
Click Cancel on the logging notification to stop logging, and open the log file
Check the log file doesn't include anything sensitive (it may have path/filenames and other things from your project depending on how long you were capturing)
On Sat, 18 Apr 2020 at 21:35, Danny Tuppeny ***@***.***> wrote:
Sorry, I should've been clearer! :-)
- Open the VS Code command palette by pressing Ctrl+Shift+P (or on
macOS, Cmd+Shift+P)
- Type "capture logs" to filter the command list, and select the *Dart:
Capture Logs* option
- Untick *Analysis Server* (those logs aren't relevant here) and click
*OK*
This will start capturing logs from the extension (a notification will be
shown in the bottom right corner that they're being captured).
- Try to launch your app so that you get the original error message
from above
- Click *Cancel* on the logging notification to stop logging, and open
the log file
- Check the log file doesn't include anything sensitive (it may have
path/filenames and other things from your project depending on how long you
were capturing)
- Save the log file and attach it here
Let me know if anything isn't clear. Thanks!
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2365 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOXXRW3V2EXRTEYLRAEM633RNG3DTANCNFSM4MLLZCBA>
.
It looks like in your .vscode/launch.json file, you have:
"program":"bin/main.dart"
However this file doesn't exist in your project. If it's a Flutter project, this should be "lib/main.dart"(or, if you've not customised the launch.json, you can just delete the file altogether).
I'm not sure how you ended up with this file with the wrong value though - bin/main.dart is the default value for a (non-Flutter) Dart project. Did you create this file and select the "Dart" template, or has it been created automatically?
Good day, I',m back with almost same problem. I cant debug, its saying
Your launch config references a program that does not exist. If you have
problems launching, check the "program" field in your ".vscode/launch.json"
file.
On Sun, Apr 19, 2020 at 2:54 PM Danny Tuppeny ***@***.***> wrote:
It looks like in your .vscode/launch.json file, you have:
"program":"bin/main.dart"
However this file doesn't exist in your project. If it's a Flutter
project, this should be "lib/main.dart"(or, if you've not customised the
launch.json, you can just delete the file altogether).
I'm not sure how you ended up with this file with the wrong value though -
bin/main.dart is the default value for a (non-Flutter) Dart project. Did
you create this file and select the "Dart" template, or has it been created
automatically?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#2365 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AOXXRW7D2KBADCHFFU5XW5LRNKU23ANCNFSM4MLLZCBA>
.
Hi Dan unluckily I am also facing the same problem, every thing was going fine and suddenly it stopped working and this alert started to appear at bottom right corner of my screen saying
"Your launch config references a program that does not exist. If you have problems launching, check the "program" field in your ".vscode/launch.json" file."
The above problem is solved, actually I keep on tracking with github so I have the previous working commit of this project, when I checked that out this line:
"program":"bin/main.dart"
It was not their and I didn't made any changes in this file aswell, so I deleted this line and and saved my project and when I reopened it every thing worked fine again like it was working before this error.
Remember I have tried this thing before but I was not closing the editor but when I restarted my editor this alert went of and it started working fine again.
You shouldn't really need a launch.json for simple cases, it should just work without. Some actions in VS Code will trigger creation of a launch.json though. If anyone can reproduce a situation where a launch.json is created and populated incorrectly with bin/main.dart (which is the default for a Dart project, but not Flutter), please let me know!
If there are other projects/folders on your vscode workspace, check and correct their ".vscode/launch.json" file configs. Or just remove those projects from the workspace.
Thanks, deleting the launch.js file and without creating a new config solved my debug/run problem.
The problem started after a flutter and dart update.
Reacted by coodtec, Obada Jasem, Gilnei Junior, Simon Siedler and Erfa
It sounds like a launch.json is being created automatically with incorrect values in it. If anyone is able to reproduce this (and figure out exactly what they did that triggered this - it might be pressing F5 with certain files open, or when the open folder in VS Code is not directly the project root, etc.), please let me know so I can try to get to the bottom of this. Thanks!
Thanks - I can repro. The issue here is that your Flutter project is in a sub-folder, so when VS code asks us for the launch.json contents, it's not clear what we should provide (the root folder is neither a Dart or Flutter project). While we could scan the workspace in this case and find your Flutter project, it's also possible we'd find multiple projects. If we return multiple configs here, VS Code would add all of them to the file.
I'll see if maybe we can take some hints from the current open file, so at least in the case where there's an open file (like in your screenshot) we should find something.
Apologies, the opposite is true. Without those args, i get refused to connect. I think my laptop has some organisation/firewall that restricts connections through specific ports. When i don't force the port to be a specific value, dart seems to just give a random port, which doesn't work for me.
changed the title [-]i cant debug/run my flutter app on visual studio code[/-][+]Default launch.json configuration is incorrect if project is nested inside a folder[/+]on Aug 5, 2020
Ok, I think I've come up with a reasonable solution for this. For the "Create launch.config", we'll now locate the project roots and create a launch config for each one. In the example above there was only one, but here's an example where the folder had a Dart project and two Flutter projects in it:
Similarly, for the "Automatic launch configs" we'll now scan each of those project roots, rather than just the main workspace root and also include options for Dart web and Test:
changed the title [-]Default launch.json configuration is incorrect if project is nested inside a folder[/-][+]Default/automatic launch configs is missing/incorrect if project is nested inside a folder[/+]on Aug 5, 2020
Activity
DanTup commentedon Apr 18, 2020
Can you try:
Thanks!
trimmdavid commentedon Apr 18, 2020
DanTup commentedon Apr 18, 2020
Sorry, I should've been clearer! :-)
This will start capturing logs from the extension (a notification will be shown in the bottom right corner that they're being captured).
Let me know if anything isn't clear. Thanks!
trimmdavid commentedon Apr 19, 2020
DanTup commentedon Apr 19, 2020
It looks like in your
.vscode/launch.jsonfile, you have:However this file doesn't exist in your project. If it's a Flutter project, this should be
"lib/main.dart"(or, if you've not customised the launch.json, you can just delete the file altogether).I'm not sure how you ended up with this file with the wrong value though -
bin/main.dartis the default value for a (non-Flutter) Dart project. Did you create this file and select the "Dart" template, or has it been created automatically?trimmdavid commentedon May 6, 2020
DanTup commentedon May 6, 2020
@trimmdavid this happens if your launch.json has a
programfield that is not on your disk. Please capture a log by:Thanks!
muhammad-hamza-shahid commentedon May 15, 2020
Hi Dan unluckily I am also facing the same problem, every thing was going fine and suddenly it stopped working and this alert started to appear at bottom right corner of my screen saying
"Your launch config references a program that does not exist. If you have problems launching, check the "program" field in your ".vscode/launch.json" file."
kindly help me out in this problem.
muhammad-hamza-shahid commentedon May 15, 2020
The above problem is solved, actually I keep on tracking with github so I have the previous working commit of this project, when I checked that out this line:
"program":"bin/main.dart"
It was not their and I didn't made any changes in this file aswell, so I deleted this line and and saved my project and when I reopened it every thing worked fine again like it was working before this error.
Remember I have tried this thing before but I was not closing the editor but when I restarted my editor this alert went of and it started working fine again.
fabiansalamo commentedon May 31, 2020
Hello, I had this isuue. I solved it by deleting the launch.js file and creating a new config using vs code.
DanTup commentedon Jun 1, 2020
You shouldn't really need a launch.json for simple cases, it should just work without. Some actions in VS Code will trigger creation of a
launch.jsonthough. If anyone can reproduce a situation where alaunch.jsonis created and populated incorrectly withbin/main.dart(which is the default for a Dart project, but not Flutter), please let me know!ellonsolomon commentedon Jun 3, 2020
If there are other projects/folders on your vscode workspace, check and correct their ".vscode/launch.json" file configs. Or just remove those projects from the workspace.
jaerts commentedon Jul 1, 2020
Thanks, deleting the launch.js file and without creating a new config solved my debug/run problem.
The problem started after a flutter and dart update.
DanTup commentedon Jul 1, 2020
It sounds like a
launch.jsonis being created automatically with incorrect values in it. If anyone is able to reproduce this (and figure out exactly what they did that triggered this - it might be pressing F5 with certain files open, or when the open folder in VS Code is not directly the project root, etc.), please let me know so I can try to get to the bottom of this. Thanks!13 remaining items
DanTup commentedon Aug 5, 2020
Thanks - I can repro. The issue here is that your Flutter project is in a sub-folder, so when VS code asks us for the
launch.jsoncontents, it's not clear what we should provide (the root folder is neither a Dart or Flutter project). While we could scan the workspace in this case and find your Flutter project, it's also possible we'd find multiple projects. If we return multiple configs here, VS Code would add all of them to the file.I'll see if maybe we can take some hints from the current open file, so at least in the case where there's an open file (like in your screenshot) we should find something.
Ah, got it. That makes sense now!
[-]i cant debug/run my flutter app on visual studio code[/-][+]Default launch.json configuration is incorrect if project is nested inside a folder[/+]DanTup commentedon Aug 5, 2020
Ok, I think I've come up with a reasonable solution for this. For the "Create launch.config", we'll now locate the project roots and create a launch config for each one. In the example above there was only one, but here's an example where the folder had a Dart project and two Flutter projects in it:
Similarly, for the "Automatic launch configs" we'll now scan each of those project roots, rather than just the main workspace root and also include options for Dart web and Test:
[-]Default launch.json configuration is incorrect if project is nested inside a folder[/-][+]Default/automatic launch configs is missing/incorrect if project is nested inside a folder[/+]Azhar978 commentedon Aug 23, 2020
i fixed it by replacing package name.
from "bin/main.dart"
to "web/main.dart"
erayhamurlu commentedon Apr 1, 2021
1- Click debug icon from left side
2- Choose Flutter from dropdown menu
3- Run your project
OR
2- Choose Flutter with your project name
3- Then click create lauch.json
ranadhaval123 commentedon Apr 19, 2021
DanTup commentedon Apr 19, 2021
@ranadhaval123 please file a new issue, and include the exact steps that led you to that error. Thanks!
Azurik52 commentedon Aug 31, 2024
if any of the solutions above didn't help, try to change launch program config like this.
Only this helped me