Flutter cannot find pubspec.yaml when running run run

Asked

Viewed 308 times

-1

I did the installation of Dart + flutter for the first time today, I did the Getting Start oriented configuration of the official website itself, but when giving RUN in the project, this error appears:

No pubspec.yaml file found.

I’ve tried to execute the flutter upgrade but still did not resolve, no flutter doctor did not appear problems and is also the latest installed version.

How can I solve?

erro flutter

  • Check if the directory you are in is the root of the project. For this you can simply open the folder by explorer windows or use the command dir in the terminal and see the files that are listed. The error you are receiving tells you that you are not at the root of the project.

  • That’s right @Leonardopaim, I ended up getting confused with the folders and so the mistake. The tip of the list of files in the terminal was important, did not know of this tool. Thank you!

  • I posted as an answer so that it can be consulted more easily.

1 answer

0


The directory you are running the command in is not the project root directory. The command flutter run needs to run in a folder that contains the files of the flutter project and the pubspec.yaml is one of those files.

A tip that can be used is to list the files in the folder. On Windows for example, you can easily check them through the command dir.

When positioning inside the folder the command will work.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.