Flutter App launch doesn t work in VS Code

0 votes

I have a project with two friends, where we are building an app. We use Azure DevOps for downloading and uploading our changes and VS Code for writing the code. Whenever I run the main.dart file it says:

Set the 'program' value in your launch config (eg 'bin/main.dart') then launch again

So I set the program value in the launch.json file do bin/main.dart. I also saw some people with the same problem, that changed it to lib/main.dart. In my project it is in a lib folder, but I tried both anyway. Both gives the same result:

ProcessException: No such file or directory...

and 

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.

Does anyone know what to do ?

Some people also deleted the .vscode folder and the launch.json file within. I did the same, however it still pops up when I run the file.

I also tried to create a new launch.json file, that didn't change anything neither.

There's no problem with flutter itself. I ran the flutter doctor multiple times and everything is working.

That's how it is at the moment: [1]: https://i.stack.imgur.com/2F5kE.png

Apr 3, 2023 in Flutter by sarit
• 1,830 points
8,675 views

1 answer to this question.

0 votes

It seems that the error message is indicating that the program specified in the launch.json file cannot be found. Here are some steps you can try:

  1. Check that the path to the main.dart file is correct. If your main.dart file is in a "lib" folder, the path should be "lib/main.dart".
  2. If the path is correct, try running the app using the "flutter run" command in the terminal instead of the VS Code launch configuration. Open a terminal in VS Code and run "flutter run".
  3. If the "flutter run" command works, there may be an issue with your launch configuration. Try creating a new launch.json file using the "Flutter: New Web/Android/iOS Launch Configuration" command in VS Code. Make sure to select the correct project and target platform.
  4. If none of the above steps work, try restarting VS Code or your computer.

Hopefully one of these steps will help you resolve the issue.

To know more, join our Flutter Certification Course today.

answered Apr 3, 2023 by Tej

Related Questions In Flutter

0 votes
1 answer
0 votes
1 answer

Linking 3 Flutter Projects in One Flutter Project

Yes, it is possible to combine multiple ...READ MORE

answered Mar 20, 2023 in Flutter by vinayak
716 views
0 votes
1 answer

How can I change the app display name build with Flutter?

Yes, you can change the app display ...READ MORE

answered Mar 21, 2023 in Flutter by venky
2,599 views
0 votes
1 answer
0 votes
1 answer

How to prevent deprecated flutter widgets suggestions in vs code?

To prevent deprecated Flutter widgets suggestions in ...READ MORE

answered Apr 6, 2023 in Flutter by vinayak
1,057 views
0 votes
1 answer

Linter pylint is not installed

Open a terminal (ctrl+~) Run the command pip ...READ MORE

answered Apr 15, 2019 in Python by SDeb
• 13,300 points
2,098 views
0 votes
1 answer

What is the future of flutter?

Hi@MD, Flutter is a rather new cross-platform framework ...READ MORE

answered Jul 17, 2020 in Others by akhtar
• 38,260 points
1,146 views
0 votes
1 answer

Is Flutter/Dart valuable in the professional setting?

Yes, Flutter and Dart are valuable skills ...READ MORE

answered Mar 21, 2023 in Flutter by vani
510 views
0 votes
1 answer

How to make flutter app responsive according to different screen size?

To make your Flutter app responsive according ...READ MORE

answered Mar 27, 2023 in Flutter by anonymous
7,287 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP