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
I am constantly getting this error for my sub-folder 'example':
<my project folder>\example: no pubspec.yaml found
Not sure how to get rid of it. However, the error does not affect anything.
You should cd to project directory, you probably are not in you opened project's root directory. If you press '+' button (new session) at the top of Flutter terminal window it automatically changes to current project folder.
To solve this error in the EASIEST WAY follow below steps :-
Go to terminal
Then find local tabs
Then click on a '+' sign and type your command.This should solve your error
See this screenshot as a guide.
This error gets thrown when you try to run flutter build apk
command (at least, it was in my case) while not being in the project
directory. Usually, a flutter app's project directory path (let's say it is in F drive, and inside a folder named apps
, is as:
F:\Apps\app_name
I had the same issue, and the culprit in my case was this path: F:\Apps\app_name\android
which is without a doubt, NOT a project directory. So, all I had to do was type this command in terminal: cd ..
which takes to the parent directory.
So, before running the command, make sure to check out the directory being shown in terminal.
flutter --version
flutter channel
you will see the current channel and for change it run flutter channel stable
and flutter doctor
commands.Possible that you are running flutter commands from a different directory. Go to project directory and try running flutter commands from there.