I am using Windows 10 with VS Code, although I also tested it on PowerShell, and both produced the same result:
After creating a new flutter program, before editing anyt
Answer
just change your directory folder project on terminal VS code.
Example
i save my project on directory D:\Project\Flutter Project\MyFirstApp and the main.dart on the directory name "first_app"
just typing like this on terminal :
cd first_app
now we're on D:\Project\Flutter Project\MyFirstApp\first_app
and then type flutter run
hopefully answer your question.
enter image description here
You should run it in the project folder. For Example: the project folder is named "first_app" and it is located in Documents, so the first go to Documents(cd Documents) then enter your project folder(cd first_app) and then run the command "flutter run".
MacBook-Pro-5:first_app username$ flutter run
only make sure you are running terminal in the main project file that has got .yaml in it
In terminal write cd your project name. Then hit enter and then write flutter run
Looks like you are running flutter run command from a different directory (maybe parent directory).
Try running flutter run command from the project directory.
I had the same issue, then I realized by default, I was running flutter clean in my sub folder. Not the project folder. Definitely run as follows in the command terminal.
cd C:\Users*\Desktop*MyProject*my_project_flutter*
then run the following
Note: cd stands for Change directory I hope this helps!