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

后端 未结 23 1925
南方客
南方客 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:14

    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.

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

    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.

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

    To solve this error in the EASIEST WAY follow below steps :-

    1. Go to terminal

    2. Then find local tabs

    3. Then click on a '+' sign and type your command.This should solve your error

    See this screenshot as a guide.

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

    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.

    0 讨论(0)
  • 2021-02-07 03:26
    • Try this command: flutter --version
    • Be sure you are on stable channel. By running flutter channel you will see the current channel and for change it run flutter channel stable and flutter doctor commands.
    0 讨论(0)
  • 2021-02-07 03:31

    Possible that you are running flutter commands from a different directory. Go to project directory and try running flutter commands from there.

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