Skip to content

No pubspec.yaml file found. #32747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
chiefmarko opened this issue Apr 3, 2018 · 14 comments
Closed

No pubspec.yaml file found. #32747

chiefmarko opened this issue Apr 3, 2018 · 14 comments

Comments

@chiefmarko
Copy link

I can see the pubspec.yaml file in my project, however, project cannot run and gives the following error:

Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.

I have tried opening new projects and all throw the same error. Please assist

@zoechi
Copy link
Contributor

zoechi commented Apr 3, 2018

What Flutter version?
Please provide the output of flutter doctor -v
Purging the Flutter install directory and install it again might be worth a try.

@chiefmarko
Copy link
Author

[√] Flutter (Channel master, v0.2.7-pre.6, on Microsoft Windows [Version 10.0.16299.309], locale en-US)
• Flutter version 0.2.7-pre.6 at C:\flutter
• Framework revision 0c89920 (32 hours ago), 2018-04-01 17:35:05 -0700
• Engine revision c903c217a1
• Dart version 2.0.0-dev.43.0.flutter-52afcba357

[!] Android toolchain - develop for Android devices (Android SDK 27.0.2)
• Android SDK at C:\Users\markk\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.2
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses

[√] Android Studio (version 3.1)
• Android Studio at C:\Program Files\Android\Android Studio
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[!] IntelliJ IDEA Ultimate Edition (version 2017.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA 2017.3.1
X Flutter plugin not installed; this adds Flutter specific functionality.
• Dart plugin version 173.4548.30
• For information about installing plugins, see
https://flutter.io/intellij-setup/#installing-the-plugins

[√] VS Code, 64-bit edition (version 1.21.1)
• VS Code at C:\Program Files\Microsoft VS Code
• Dart Code extension version 2.11.1

[√] Connected devices (1 available)
• RAINBOW LITE 4G • 65b6f03e • android-arm • Android 5.1.1 (API 22)

! Doctor found issues in 2 categories.

@chiefmarko
Copy link
Author

Tried purging and re-installing flutter, dart and associated plugins to no avail

@zoechi
Copy link
Contributor

zoechi commented Apr 4, 2018

Did you try accepting the licenses?

@kevmoo
Copy link
Member

kevmoo commented Apr 4, 2018

Please ask this type of question in https://stackoverflow.com/

Did you run the command in the directory w/ pubspec.yaml?

Closing as this doesn't seem an issue – but happy to help you figure things out.

@kevmoo kevmoo closed this as completed Apr 4, 2018
@chiefmarko
Copy link
Author

Yeah directory has pubspec.yaml

@zoechi
Copy link
Contributor

zoechi commented Apr 6, 2018

Is this when you run it on iPhone or iOS emulator or also on Android?
Could be a dup of flutter/flutter#9706 or flutter/flutter#2990

@chiefmarko
Copy link
Author

Android

@zoechi
Copy link
Contributor

zoechi commented Apr 6, 2018

If you can still reproduce I'd suggest you create a new issue in the Flutter repo with more information about your project, and in which directory the pubspec.yaml is, what it contains and in what directory you run your app using what command.

@zoechi
Copy link
Contributor

zoechi commented Apr 6, 2018

See also flutter/flutter#16100

@saravananmnm
Copy link

still i got this error, when i run flutter clean command.

Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.
Do not run this command from the root of your git clone of Flutter.

Flutter 1.5.4-hotfix.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 7a4c33425d (8 weeks ago) • 2019-04-29 11:05:24 -0700
Engine • revision 52c7a1e849
Tools • Dart 2.3.0 (build 2.3.0-dev.0.5 a166856)

Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.5.4-hotfix.2, on Microsoft Windows [Version 10.0.17134.829], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[√] Android Studio (version 3.4)
[√] Connected device (1 available)

• No issues found!
Process finished with exit code 0

image

@lightcomet
Copy link

lightcomet commented Jul 16, 2019

Not sure if the pubspec.yaml should be at the root directory of your application, but I'm guessing in your case it should be at "C:\Saravanan\Flutter_visibility\tvs_invisibility" instead of inside the "test" subfolder. Secondly, the terminal seems to be pointing at another folder directory namely "C:\Saravanan\Flutter_SDK\flutter", hence you might want to change the directory it is pointing at to the "C:\Saravanan\Flutter_visibility\tvs_invisibility".

For my case, the pubspec.yaml file and the other files was at the folder "C:\Desktop\Flutter\my_app_name\my_app_name" when i created the new project using "Flutter: New Project". In the first "my_app_name" folder, it had nothing except for another "my_app_name" folder, thus i had to move all the files to one level before which is ""C:\Desktop\Flutter\my_app_name" and ensure that the terminal is pointing to this directory before running the flutter run command, the flutter doctor can run even if it is not pointing to the root of the directory, but "flutter run" can only execute when pointing at the correct directory.

@Grohden
Copy link

Grohden commented Mar 4, 2020

I was getting this one when running flutter pub get on a dart only lib project (which I've created with intellij interface)... the solution for me, was to use pub get (from dart sdk folder) instead of flutter pub get

@DLKenrickASU
Copy link

In case anyone else has this problem - I had this issue and then I realized I was trying to launch from the wrong folder (my app was in a sub folder). So I just needed to change directories in the terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants