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

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

提交回复
热议问题