How do I fix “No pubspec.yaml file found” in flutter?

后端 未结 23 1961
南方客
南方客 2021-02-07 02:46

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

相关标签:
23条回答
  • 2021-02-07 03:09

    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

    0 讨论(0)
  • 2021-02-07 03:10

    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

    0 讨论(0)
  • 2021-02-07 03:12

    only make sure you are running terminal in the main project file that has got .yaml in it

    0 讨论(0)
  • 2021-02-07 03:13

    In terminal write cd your project name. Then hit enter and then write flutter run

    0 讨论(0)
  • 2021-02-07 03:13

    Looks like you are running flutter run command from a different directory (maybe parent directory).

    Try running flutter run command from the project directory.

    0 讨论(0)
  • 2021-02-07 03:13

    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

    1. flutter clean
    2. flutter run

    Note: cd stands for Change directory I hope this helps!

    0 讨论(0)
提交回复
热议问题