Beginner help: The system cannot find the path specified

Viewed 8051

I'm just starting to use Dart in Visual Studio code and having some problems.

I've gone into Visual Studio Code, gone to File-->Open Folder..then created a folder with another folder inside, and then selected it. Then I downloaded package-simple through the terminal.Then when I go to explorer, I see that there is already pre-made code..ie under lib, src, there is a simple_console_example.dart file.

When I try to run this file I get a bin/main.dart:1: Error: The system cannot find the path specified.

Any help is appreciated!

3 Answers

If you're running flutter extension in visual studio code for a sub-root directory, then debugging may yield the error whereas flutter run would work.

Solution is to open the sub-directory as folder in visual studio code.


If you're having this error for no apparent reason, try running commands below in the root directory of the project as suggested in this solution:

flutter clean & flutter run

Running

flutter clean & flutter run

from a terminal worked but it didn't fix the issue that I couldn't run a Debug session from within Visual Studio Code. The fix that did it for me was:

The solution is to delete .vscode folder inside your project

which I found here: Issue #29589 on Flutter Github Project

I have the same problem. find out that in my visual studio code at the explorer, i opened the wrong folder for my project. make sure your visual studio code is opening your folder project at the explorer nav bar on the left. File=>Open Folder=>"your project folder file.

Related