Error no pubspec yaml file found

I my visual code I continue doing my work suddenly an error come flutter packages get Error: No pubspec.yaml file found. This command should be run from the root of your Flutter project. Do not run...

@zoechi

Please add the output of flutter doctor -v.

What I do is create a new project and replace all my files and modifying manifest xml,yaml file ,info list . Is this the only solution and continue repeating this ??

This should definitely not be necessary but we need more information to be able to reproduce.

flutter packages get
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.

Is this the full output?
What does happen if you execute

from a command line shell instead of from VSCode?

@rakz25

Yes from terminal of VSCode and yes again its’s the full output . I am not
able to put up a screen shot now since I have already repeated the same
traditional way by creating and replacing files .
I have tried flutter doctor too but the the error doesn’t seem to go.

On Mon, Jul 30, 2018 at 1:20 PM, Günter Zöchbauer ***@***.***> wrote:
Please add the output of flutter doctor -v.

What I do is create a new project and replace all my files and modifying
manifest xml,yaml file ,info list . Is this the only solution and continue
repeating this ??

This should definitely not be necessary but we need more information to be
able to reproduce.

flutter packages get
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.

Is this the full output?
What does happen if you execute

flutter packages get

from a command line shell instead of from VSCode?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#19973 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARyx8AihmjS7PDhWYTyfiT0jLdczd6K4ks5uLrrbgaJpZM4VlyGq>
.

@zoechi
zoechi

changed the title
No pub spec.yaml found

No pubspec.yaml found

Jul 30, 2018

@zoechi
zoechi

added

severe: crash

Stack traces logged to the console.

tool

Affects the «flutter» command-line tool. See also t: labels.

labels

Jul 30, 2018

@DanTup

The code that outputs this error only does a basic check to see whether there’s a pubspec.yaml in the current folder. It’s very easy to get this if you’ve cd‘d into a sub-folder of your project:

dantup-macbookpro:flutter_gallery dantup$ flutter packages get
Running "flutter packages get" in flutter_gallery...         0.8s

dantup-macbookpro:flutter_gallery dantup$ cd lib/

dantup-macbookpro:lib dantup$ flutter packages get
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.

When you see this again, you should check the folder that you’re running it from (you can run pwd (or cd on Windows) in the terminal to get the full path). If you believe you’re running it from the right place (the root of your Flutter project), you should run ls pubspec.yaml (or dir pubspec.yaml on Windows) in the same terminal to verify whether the file is there.

@rakz25

Yes, Initially, I have tried that too export PATH and setting up a path
variable , ls, echo $PATH which shows the correct path ex:if my flutter sdk
is in downloads, /users /name/downloads /flutter /bin :
But sometimes it shows a wrong suddenly
/users/name/downloads/bin:documents/flutter/bin:/usr/bin:
Such weird path but when I quit editor, and run my commands it shows the
correct path but error still remains which ultimately provokes me too go
through such activities like creating a new project and replacing.
Thank you for the support.

On 30-Jul-2018 8:13 PM, «Danny Tuppeny» ***@***.***> wrote:
The code that outputs this error only does a basic check to see whether
there’s a pubspec.yaml in the current folder. It’s very easy to get this
if you’ve cd’d into a sub-folder of your project:

dantup-macbookpro:flutter_gallery dantup$ flutter packages get
Running «flutter packages get» in flutter_gallery… 0.8s

dantup-macbookpro:flutter_gallery dantup$ cd lib/

dantup-macbookpro:lib dantup$ flutter packages get
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.

When you see this again, you should check the folder that you’re running
it from (you can run pwd (or cd on Windows) in the terminal to get the
full path). If you believe you’re running it from the right place (the root
of your Flutter project), you should run ls pubspec.yaml (or dir
pubspec.yaml on Windows) in the same terminal to verify whether the file
is there.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#19973 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARyx8EMsutmsWICSUbbKulr9-RIsbI76ks5uLxuDgaJpZM4VlyGq>
.

@DanTup

@rakz25 This has nothing to do with the PATH environment variable, this is the folder where you’re executing flutter packages get from. It needs to be run from the root of your project.

When you see this again, please immediately run pwd and ls pubspec.yaml in the same terminal and post the output and/or a screenshot here. It seems like you may be executing it in the wrong folder.

@rakz25

These are screenshots : My flutter project is in desktop and flutter sdk is
in downloads:

@DanTup

@rakz25 No screenshots came through with your last message (not sure if GitHub doesn’t handle them from emails or if you forgot to attach?)

@rakz25

aaa
bbb

I have attached it but not showing in GitHub

@DanTup

@rakz25 You need to run those commands in the same VS Code Terminal window where you saw the error message.

Some other potential issues though:

  1. You’re possibly on an outdated version of Flutter (please post flutter --version)
  2. VS Code has not detected your project as a Flutter project (it shows Dart: 1.24.3 in the status bar). Can you confirm which folder you’re opening in VS Code? It should be the root of your Flutter project. If it is, then that also suggests you are missing your pubspec.yaml file?

My guess is that the folder you’re opening in VS Code (PracticeFlutter) is not the root of a Flutter project. This would explain both the message you’re seeing and also VS Code not detecting this as a Flutter project.

@rakz25

Well to be frank: These are the simple steps I followed
1) I created a new project (app_project ex:)

2) Then created a new folder on my desktop (AppFolder -> app_project)

3) When I open VSCode (Goto : Open Folder -> Select -> AppFolder -> Open)

4) Starts analyzing…….
5)Now then it starts well and fine but no idea it sudenly gets the
pubspec.yaml error . Where am I going wrong exactly ? I have tried those
commands on editor terminal too.

On Tue, Jul 31, 2018 at 4:36 PM, Danny Tuppeny ***@***.***> wrote:
@rakz25 <https://github.com/rakz25> You need to run those commands in the
same VS Code Terminal window where you saw the error message.

Some other potential issues though:

1. You’re possibly on an outdated version of Flutter (please post flutter
—version)
2. VS Code has not detected your project as a Flutter project (it
shows Dart: 1.24.3 in the status bar). Can you confirm which folder
you’re opening in VS Code? It should be the root of your Flutter project.
If it is, then it seems like you may be missing your pubspec.yaml file?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#19973 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ARyx8P3cliQrY8fSTv6We48MpHMZTjCyks5uMDoegaJpZM4VlyGq>
.

@rakz25

Flutter Version:

flutter —version
Flutter 0.5.8-pre.187 • channel master •
https://github.com/flutter/flutter.git
Framework • revision

12eff1d

(6 hours ago) • 2018-07-31 08:05:24 +0100
Engine • revision

af855e0

Tools • Dart 2.0.0-dev.69.4.flutter-08f59e5de3

On Tue, Jul 31, 2018 at 6:10 PM, rakesh lorentz <rakeshlorentz@gmail.com>
wrote:

Well to be frank: These are the simple steps I followed
1) I created a new project (app_project ex:)

2) Then created a new folder on my desktop (AppFolder -> app_project)

3) When I open VSCode (Goto : Open Folder -> Select -> AppFolder -> Open)

4) Starts analyzing…….
5)Now then it starts well and fine but no idea it sudenly gets the
pubspec.yaml error . Where am I going wrong exactly ? I have tried those
commands on editor terminal too.

On Tue, Jul 31, 2018 at 4:36 PM, Danny Tuppeny ***@***.***>
wrote:

> @rakz25 <https://github.com/rakz25> You need to run those commands in
> the same VS Code Terminal window where you saw the error message.
>
> Some other potential issues though:
>
> 1. You’re possibly on an outdated version of Flutter (please post flutter
> —version)
> 2. VS Code has not detected your project as a Flutter project (it
> shows Dart: 1.24.3 in the status bar). Can you confirm which folder
> you’re opening in VS Code? It should be the root of your Flutter project.
> If it is, then it seems like you may be missing your pubspec.yaml
> file?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <#19973 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/ARyx8P3cliQrY8fSTv6We48MpHMZTjCyks5uMDoegaJpZM4VlyGq>
> .
>

@DanTup

You should open the project folder in VS Code, so if app_project is the folder that contains a pubspec.yaml then that’s the folder you want to open in VS Code.

It is possible to open a parent folder (eg. if you have multiple sub-projects) but there are some complications so if you have only one project, you’re better open its folder directly.

If you do this correctly, you’ll see the Flutter version in the status bar, which will enable functionality you’re not currently getting (like fetching packages when you save the pubspec, allowing you to press F5 to run (inc. launching emulators), Flutter-specific snippets and commands in the Palette).

@rakz25

Well I got it ! Thank you so much. Thanks a lot

On Tue, Jul 31, 2018 at 6:14 PM, rakesh lorentz <rakeshlorentz@gmail.com>
wrote:

Flutter Version:

flutter —version
Flutter 0.5.8-pre.187 • channel master • https://github.com/flutter/
flutter.git
Framework • revision

12eff1d

(6 hours ago) • 2018-07-31 08:05:24 +0100
Engine • revision

af855e0

Tools • Dart 2.0.0-dev.69.4.flutter-08f59e5de3

On Tue, Jul 31, 2018 at 6:10 PM, rakesh lorentz ***@***.***>
wrote:

> Well to be frank: These are the simple steps I followed
> 1) I created a new project (app_project ex:)
>
> 2) Then created a new folder on my desktop (AppFolder -> app_project)
>
> 3) When I open VSCode (Goto : Open Folder -> Select -> AppFolder -> Open)
>
> 4) Starts analyzing…….
> 5)Now then it starts well and fine but no idea it sudenly gets the
> pubspec.yaml error . Where am I going wrong exactly ? I have tried those
> commands on editor terminal too.
>
>
> On Tue, Jul 31, 2018 at 4:36 PM, Danny Tuppeny ***@***.***>
> wrote:
>
>> @rakz25 <https://github.com/rakz25> You need to run those commands in
>> the same VS Code Terminal window where you saw the error message.
>>
>> Some other potential issues though:
>>
>> 1. You’re possibly on an outdated version of Flutter (please post flutter
>> —version)
>> 2. VS Code has not detected your project as a Flutter project (it
>> shows Dart: 1.24.3 in the status bar). Can you confirm which folder
>> you’re opening in VS Code? It should be the root of your Flutter project.
>> If it is, then it seems like you may be missing your pubspec.yaml
>> file?
>>
>> —
>> You are receiving this because you were mentioned.
>> Reply to this email directly, view it on GitHub
>> <#19973 (comment)>,
>> or mute the thread
>> <https://github.com/notifications/unsubscribe-auth/ARyx8P3cliQrY8fSTv6We48MpHMZTjCyks5uMDoegaJpZM4VlyGq>
>> .
>>
>
>

@DanTup

Great!

You shouldn’t need to use the terminal directly so much now, a lot of the Flutter commands appear in the VS Command Palette (and run/debug is handled with F5). If you hit any issues specifically with the VS Code integration, open issues over at https://github.com/Dart-Code/Dart-Code and I’ll pick them up.

@olisteadman

@rakz25 what was the adjustment you made to get this working? I have encountered the same issue of flutter’s not being able to see my pubspec.yaml file:

screen shot 2019-02-11 at 22 01 47

… and I can’t elucidate from the comments above, what you did to finally get it working.

@DanTup in the screenshot above, I’m trying to explicitly show that I’ve:

  • checked which directory I’m in
  • checked that pubspec.yaml is in that directory
  • called the correct SDK using ~/flutter/bin/flutter

Other useful info:

  • I am using Terminal rather than terminal window inside any IDE
  • I checked the version (Flutter 1.0.0, Dart 2.1.0) (see gist)
  • I checked the output of flutter doctor -v (and saw no errors) (see the same gist)

Any help would be hugely appreciated.

@olisteadman

I can confirm that I’ve now solved this, by simply deleting the subdirectory /Users/oliversteadman/AndroidStudioProjects/nanny/example which, for some reason it’d be good to understand, flutter seemed to be jumping into when running flutter packages get.

The only file inside that subdir was example.dart a basic template file, so it’s not a big deal.
But it seems like we are restricted to not having any subdir’s named example (and maybe other names?). @DanTup is this expected/documented behaviour?

@DanTup

@olisteadman My guess is that flutter packages get is set up to also work for your example project (which is news to me, since in VS Code I handle this manually — I’ll make a note to check). I think it’s expected that if you have an example folder, it contains a pubspec (I guess it’s supposed to be a whole sample project, so needs a pubsec/to list its dependencies/etc.).

@irenejohn997

This is the error i get when i run flutter packages get,please somebody should help me,i have been on this for the past 1 month now
Screenshot (24)

@Giridharaan1705

I my visual code I continue doing my work suddenly an error come

flutter packages get
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.(very frequently)

What I do is create a new project and replace all my files and modifying manifest xml,yaml file ,info list . Is this the only solution and continue repeating this ??

First open the command prompt and create your project and then open your project in vs code and then run in vs code it will work it seems

@github-actions

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions
github-actions
bot

locked as resolved and limited conversation to collaborators

Aug 19, 2021

Содержание

  1. No pubspec.yaml file found. #32747
  2. Comments
  3. How to Fix “No pubspec.yaml File Found” In Flutter?
  4. How to Fix “No pubspec.yaml File Found” In Flutter?
  5. 2 thoughts on “ How to Fix “No pubspec.yaml File Found” In Flutter? ”
  6. Popular Posts
  7. How to set up an Emulator For VSCode? (Updated)
  8. How to Format DateTime In Flutter ?
  9. How to Solve Unable to load asset in Flutter?
  10. No pubspec.yaml found #19973
  11. Comments
  12. When app is in OneDrive directory «flutter pub get» returns Error: No pubspec.yaml file found. #53392
  13. Comments
  14. Could not find a file named «pubspec.yaml» in #1850
  15. Comments

No pubspec.yaml file found. #32747

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

The text was updated successfully, but these errors were encountered:

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.

[√] 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 0c89920069 (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:UsersmarkkAppDataLocalAndroidsdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-27, build-tools 27.0.2
• Java binary at: C:Program FilesAndroidAndroid Studiojrebinjava
• 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 FilesAndroidAndroid 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 FilesJetBrainsIntelliJ 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 FilesMicrosoft 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)

Источник

How to Fix “No pubspec.yaml File Found” In Flutter?

Sometimes when a user runs a Flutter Project He/She gets an error saying “No pubspec.yaml file found“. So in this article, we will go through How to Fix “No pubspec.yaml File Found” In Flutter?

How to Fix “No pubspec.yaml File Found” In Flutter?

Looks like when the user running the flutter run command from a Different Directory.

Try running the flutter run command from the project directory.

To Solve this error in the EASIEST WAY follows the below steps:

  • Go to terminal
  • Then find local tabs
  • Then click on a ‘+‘ sign and type your command. This should solve your error

Users can also give a try like the below code snippet.

Match the steps you have done from below mentioned steps and make changes where needed:

  • Clone flutter or unzip Flutter SDK and move the flutter folder to C drive.
  • Now check whether the flutter is installed properly or not by running the command(flutter –version) from any folder. Make sure you have set the flutter path inside the environment variable.
  • If it is installed, move to any folder where you want to create your project and type this command “flutter create project_name
  • Now move to the folder you have recently created and then run “flutter run” from that folder

FlutterAgency.com is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget Guide, Flutter Projects, Code libs and etc.

FlutterAgency.com is one of the most popular online portal dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge on Flutter.

2 thoughts on “ How to Fix “No pubspec.yaml File Found” In Flutter? ”

Didn’t get any success after your idea is there anything other than this for solving the same

There could be something but for that, I need to see the exact problem buddy !!

Request a Quote

Popular Posts

How to set up an Emulator For VSCode? (Updated)

An Emulator is a hardware device or software program that enables one computer system to imitate the functions of another …

How to Format DateTime In Flutter ?

Many times it may happen that the user needs to display the current DateTime in a Text Widget. Depending on …

How to Solve Unable to load asset in Flutter?

Every mobile application requires to display predefined images stored in an assets folder. Sometimes Flutter displays an error that says …

Источник

No pubspec.yaml found #19973

I my visual code I continue doing my work suddenly an error come

What I do is create a new project and replace all my files and modifying manifest xml,yaml file ,info list . Is this the only solution and continue repeating this ??

The text was updated successfully, but these errors were encountered:

Please add the output of flutter doctor -v .

What I do is create a new project and replace all my files and modifying manifest xml,yaml file ,info list . Is this the only solution and continue repeating this ??

This should definitely not be necessary but we need more information to be able to reproduce.

flutter packages get
Error: No pubspec.yaml file found.
This command should be run from the root of your Flutter project.

Is this the full output?
What does happen if you execute

from a command line shell instead of from VSCode?

The code that outputs this error only does a basic check to see whether there’s a pubspec.yaml in the current folder. It’s very easy to get this if you’ve cd ‘d into a sub-folder of your project:

When you see this again, you should check the folder that you’re running it from (you can run pwd (or cd on Windows) in the terminal to get the full path). If you believe you’re running it from the right place (the root of your Flutter project), you should run ls pubspec.yaml (or dir pubspec.yaml on Windows) in the same terminal to verify whether the file is there.

@rakz25 This has nothing to do with the PATH environment variable, this is the folder where you’re executing flutter packages get from. It needs to be run from the root of your project.

When you see this again, please immediately run pwd and ls pubspec.yaml in the same terminal and post the output and/or a screenshot here. It seems like you may be executing it in the wrong folder.

@rakz25 No screenshots came through with your last message (not sure if GitHub doesn’t handle them from emails or if you forgot to attach?)


I have attached it but not showing in GitHub

@rakz25 You need to run those commands in the same VS Code Terminal window where you saw the error message.

Some other potential issues though:

  1. You’re possibly on an outdated version of Flutter (please post flutter —version )
  2. VS Code has not detected your project as a Flutter project (it shows Dart: 1.24.3 in the status bar). Can you confirm which folder you’re opening in VS Code? It should be the root of your Flutter project. If it is, then that also suggests you are missing your pubspec.yaml file?

My guess is that the folder you’re opening in VS Code ( PracticeFlutter ) is not the root of a Flutter project. This would explain both the message you’re seeing and also VS Code not detecting this as a Flutter project.

You should open the project folder in VS Code, so if app_project is the folder that contains a pubspec.yaml then that’s the folder you want to open in VS Code.

It is possible to open a parent folder (eg. if you have multiple sub-projects) but there are some complications so if you have only one project, you’re better open its folder directly.

If you do this correctly, you’ll see the Flutter version in the status bar, which will enable functionality you’re not currently getting (like fetching packages when you save the pubspec, allowing you to press F5 to run (inc. launching emulators), Flutter-specific snippets and commands in the Palette).

Источник

When app is in OneDrive directory «flutter pub get» returns Error: No pubspec.yaml file found. #53392

I keep running into this 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 got stuck earlier with the same error and so I created new project by running ‘flutter create testapp’. I was able run the default App in Chrome using ‘flutter run -d chrome’. Then I updated pubspec.yaml to include few images that I added to the assets/images folder. The hot reload didn’t pick the changes, so had to exit the App and then ran ‘flutter pub get’ as below and I’m stuck again!

I’m on Windows 10 Pro. Here’s the results of some flutter commands that could be useful.

I tried deleting the old flutter folder, installed it fresh on to a new folder, updated the PATH, restarted the machine etc .. but no luck!

I’m using VSCode.

Let me know if you need any additional info to troubleshoot . I’m not able to explore Flutter beyond the first few steps . kindly assist!

The text was updated successfully, but these errors were encountered:

I tried reverting the pubspec.yaml changes to comment the assets as shown below but its still throwing the same error when I try to run ..

Related to #52997.
@ajith007 could you provide your flutter pub get —verbose ?

@VladyslavBondarenko , thank you for the response.
here’s the info requested —

Источник

Could not find a file named «pubspec.yaml» in #1850

i’ve got error like this when trying to install flutter.
i run
flutter doctor
and suddenly i got error like this :

i’ve got the log, and here it is:

OS : Ubuntu 17.10

The text was updated successfully, but these errors were encountered:

What Flutter version are you using?
flutter —version

@zoechi i got clone of the flutter repo today for installing it and i wasn’t able to install it. and when i tried to run flutter —version i got above error

Sounds like a network issue
You don’t have by any chance a space in the Flutter install directory path?

yes, i just update my answer . i got above error again trying to get version.
and i have enough space in install directory path for installation

@zoechi even deleting pub cache wasn’t helpful. any idea ?

I wouldn’t expect deleting pub cache to have effect

@nex3 @natebosch can this issue be reopened here? It looks like this error is caused by invalid pubspec.yaml and there should be a better error message from pub.

I saw an example where the first line had a few spaces before name: . and flutter/flutter#15948 mentions examples with invalid path: .

People run into this quite often.

There are actually 2 different cases (which I wasn’t aware before)

A few I found in a Google search. Some are older but I think they show that in many situations the error message is not helpful. Perhaps there is a way to get more information about the root cause.

Update Seems there is another source of this error
caused by Chinese Pub mirror server being down or not responding properly for some other reason

This is another open Pub issue with the same error

and there is a similar error message

I just put this here to gather more information and perhaps find a pattern.

@zoechi did you come across a simple repro for this?

@mit-mit no, every attempt to reproduce failed so far.

There were 2 cases where fixing the content of pubspec.yaml seems to have solved it, but I wasn’t able to reproduce that way.

Most other cases were broken

/.pub-cache or where some radical actions like reinstalling Flutter seems to have fixed it.

Simple write in terminal ,
cd your project name // for windows
flutter run // use for run your application .

@mit-mit feel free to close. I won’t have time to investigate further anytime soon.
We can reopen if new information emerges that would allow to track the cause down.

I am having this problem right now. I’ve already tried deleting the whole flutter directory but nothing works.

I noted that the library folder is created inside the hosted folder (inside the .pub-cache ), but it’s empty.

Any idea what may be causing this?

I am having the same problem.

Could not find a file named «pubspec.yaml» in «C:srcflutter.pub-cachehostedpub.dartlang.orgsqflite-0.13.0».

pub get failed (66)

I’m having an error Could not find a file named «pubspec.yaml» in «C:UsersiftekAppDataRoamingPubCachehostedpub.dartlang.orgquiver-2.0.1».

I had changed some git: dependencies to path: dependencies.

After reverting, I get the error.

If I remove the .git suffix from the url, flutter packages get runs normally.

Remove .git work for me.

This is a pretty old, closed bug. If anyone is still experiencing issues, please file new issues (and kindly include as much information, repro steps, etc. as possible).

I reproduced it simply.
I create a basic flutter application, I then copy the following
audio_service:
path: ../

Adding audio_service does not create the issue. Adding then «path: ../» brings:

Running «flutter pub get» in singing_buttons.
Could not find a file named «pubspec.yaml» in «. AndroidStudioProjects».
pub get failed (66; Could not find a file named «pubspec.yaml» in «. /AndroidStudioProjects».)
Process finished with exit code 66_

I create a basic flutter application, I then copy the following

That’s always wrong.. unless you’re doing it from the audio_service/example folder, you can’t path import..

Источник

score:-4

You need to execute the following command:

flutter pub global activate webdev

score:-1

you can find this pubspex.yaml in flutter in following location
srcflutterpackagesflutter_tools
open CMD change Directory into above location and now you can run flutter upgrades get and other command.
This one is working complete fine for me. Hope this will work for you

score:0

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

score:0

I saw this error for invalid pubspec.yaml content, like for example spaces before

name: my_app

like

    name: my_app`

score:0

step 1 : Add this to your package’s pubspec.yaml file:
url_launcher: ^5.0.2

step 2: When You come back to main.dart file you can see the get dependencies. when yo click on that link «flutter packages get» command will run. You can get the URL Launcher package

score:0

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:Appsapp_name

I had the same issue, and the culprit in my case was this path: F:Appsapp_nameandroid 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.

score:0

In my case, i was using a VS code in Windows 10 and when i created a new project by Flutter: New Project
it failed to create the following project files & folders under the project location

  • android

  • ios

  • lib
  • pubspec.lock
  • pubspec.yaml and few more files.

I tried creating another project and that successfully created with all the necessary files.

Sound dumb but this is what exactly happened to me.

Hope it helps someone.

score:0

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.

score:0

  • 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.

score:0

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

score:0

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

score:0

Got a similar error:

The directory ../ does not contain a pubspec.

This is because I was referring to a folder that did not have a pubspec.yaml file.

Solution:

Change from:

  file_picker:
    path: ../

To

  file_picker:
    path: ./

score:0

if you are a linux user, the copy this line.
sudo chown -R username home/username/
this should give you permission to every file into home/username/

score:1

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.

score:2

For me the culprit was OneDrive. I had to reinstall Windows 10 and when I did, it offered to setup OneDrive for me automatically. I thought — great, one less thing… Then later I realized that it had set itself up with the Files On Demand option set to true. Microsoft never ceases to elicit a facepalm from me with the things they think are great ideas. Just to verify that this was the problem, I copied the entire folder to a temporary location on my hard drive that wasn’t synced to OneDrive and it ran fine.

If something has been corrupted in the process of trying to build and run without all the files accessible, hopefully you have a recent commit from github (prior to putting the project on OneDrive) that you can clone. This is assuming your problem has the same cause as mine.

score:2

Maybe you should check to see if the project directory you opened is correct. I had this problem because the project directory opened to the project’s parent directory. You must ensure that the file exists in the project directory you have opened.

score:2

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

score:2

It seems you are running command from the flutter sdk installed folder. Instead you should run the command from the project you have created.

Match your steps you have done from below mentioned steps:

  1. Clone flutter or unzip flutter sdk (you have downloaded) and move the flutter folder to C drive.

  2. Now check whether the flutter is installed properly or not by running command(flutter —version) from any folder. Make sure you have set the flutter path inside environment variable.

  3. If it is installed, move to any folder where you want to create your project and type this command «flutter create project_name«

  4. Now move to the folder you have recently created and then run «flutter run» from that folder

I think this will surely help you.

score:2

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

It Simple means that your terminal is currently not in your flutter project
the path of the directory is wrong,

Solve it by navigate to the flutter folder
change directory
Eg : cd portfolio

after changing the terminal directory path

C:Android Studio StuffFlutter Projectportfolio> // your command

score:3

You can use flutter clean command and then try

flutter run In your terminal

score:5

@James M, go to command prompt and run

flutter upgrade

and then try to create a new project using the command

flutter create new_project

It would work fine.

score:5

ERROR is simple You are in the wrong directory and trying to run your command in CMD in the wrong directory.

SOLUTION:

  1. First move to the directory in which pubspec.yaml is located. (Like in my case it is C:UsersA12AndroidStudioProjectswork1 (A12 is my username and work1 is project
    name))
  2. Now try to run your command it will work fine.

score:8

Answer

just change your directory folder project on terminal VS code.

Example

i save my project on directory D:ProjectFlutter ProjectMyFirstApp
and the main.dart on the directory name «first_app»

just typing like this on terminal :

cd first_app

now we’re on D:ProjectFlutter ProjectMyFirstAppfirst_app

and then type flutter run

hopefully answer your question.

enter image description here

score:9

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!

score:37

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.

score:43

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

Try running flutter run command from the project directory.

Related Query

  • How to find pubspec yaml of Dart file to fix null safety issue?
  • How to fix ‘No pubspec.yaml file found’ when flutter project in OneDrive folder?
  • How to fix the firebase error I get after importing firebase auth in my dart file in flutter app?
  • How to fix ‘firebase_auth/FirebaseAuthPlugin.h’ file not found in Xcode?
  • How do I fix «Error: No pubspec.yaml file found.» in flutter w/ Android studio?
  • How to fix header file not found when Archive build on Xcode?
  • How to fix «unexpected element <queries> found in <manifest>» error?
  • error: ‘Flutter/Flutter.h’ file not found when flutter run on iOS
  • How can I have my AppBar in a separate file in Flutter while still having the Widgets show?
  • How to render a local HTML file with flutter dart webview
  • Flutter : Target file «lib/main.dart» not found
  • How do I fix «No pubspec.yaml file found» in flutter?
  • How to Fix Flutter Warning: Your Flutter application is created using an older version
  • How to fix ‘net::ERR_CLEARTEXT_NOT_PERMITTED’ in flutter
  • how do I check the file size of a video in flutter before uploading
  • How to Save Image File in Flutter ? File selected using Image_picker plugin
  • Flutter — The iOS Simulator deployment target ‘IPHONEOS_DEPLOYMENT_TARGET’ is set to 7.0 && Build input file cannot be found GoogleService-Info.plist
  • How to convert Uint8List image to File Image for upload in flutter web
  • How to convert a XFile to File in Flutter
  • How to fix black screen in flutter while Navigating?
  • How to read and write a text file in Flutter
  • How to save and download text file in Flutter web application
  • How to share a file using flutter
  • Flutter: how to delete a file inside the Flutter app directory
  • How to fix flutter AndroidX incompatibility?
  • How to get progress event while uploading file on http.MultipartRequest request in flutter
  • Flutter — how to save a file on IOS
  • How to fix this error Task ‘assembleAarRelease’ not found in root project ‘flutter_plugin_android_lifecycle’.?
  • How to fix «A dismissed Dismissible widget is still part of the tree.» error in flutter
  • How to fix «Gradle build failed to produce an Android bundle package.» in Flutter

More Query from same tag

  • Pass data from flutter to native IOS
  • how to show local html folder in webview
  • Hinttext in the TextFormField is not aligned with the prefix and suffix Icon
  • How to check whether the user email id exists?
  • always routed to signin page
  • Flutter: There should be exactly one item with [DropdownButton]’s value
  • Dart/Flutter : Avoid Method parsing in Map , when converting to JSON?
  • How to open a Dialog in flutter when a value changes in a ChangeNotifierProvider
  • «UNIQUE constraint failed» error, but post request still works
  • Exception has occurred. Where is the actual error for this problem in Flutter?
  • Flutter TeXView (webview) not rendering on android emulator
  • How do I get an array/list filled with all the image paths I loaded as assets in Flutter?
  • Error trying to run a Flutter WEB app, using Firebase Remote Config
  • HTTP Connection issue
  • Using the triple-shift (>>>) operator in Dart
  • Flutter: Firebase send me a wrong code in flutter app
  • Any ideas on why a «flutter install» to an android device doesn’t show anything but «flutter run» works fine
  • The body might complete normally, causing ‘null’ to be returned, but the return type is a potentially non-nullable type. / Flutter
  • Solve PlatformException (PlatformException(user-not-found)) Firebase
  • The performance of an InheritedWidget
  • How can I show alert dialog on base of a stream in case network request fails
  • How do I make a subcollection of user data in Firebase?
  • Change all children’s font family in Flutter
  • Flutter using the map function to create a statless widget for each element in a list
  • How to show CircularProgressIndicator while build state is running in Flutter?
  • How to run workmanager every 15 minutes in the background in flutter IOS
  • How to add a countdown timer in a row, with event trigger when reacher zero in flutter?
  • Flutter [in_app_purchase] Get all plans inside subscription
  • Flutter: Uncaught ReferenceError: firebase is not defined
  • How can I go to the page when I click the button in PageView?

Hi Guys,

I am trying to run the flutter run command, but it is showing me the below error.

C:UsersNadeem AkhterDesktopvscode>flutter run
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.

How can I solve this error?







Jul 20, 2020


in Others


by



• 38,240 points





7,224 views



1 answer to this question.

Related Questions In Others

  • All categories

  • ChatGPT
    (4)

  • Apache Kafka
    (84)

  • Apache Spark
    (596)

  • Azure
    (131)

  • Big Data Hadoop
    (1,907)

  • Blockchain
    (1,673)

  • C#
    (141)

  • C++
    (271)

  • Career Counselling
    (1,060)

  • Cloud Computing
    (3,446)

  • Cyber Security & Ethical Hacking
    (147)

  • Data Analytics
    (1,266)

  • Database
    (855)

  • Data Science
    (75)

  • DevOps & Agile
    (3,575)

  • Digital Marketing
    (111)

  • Events & Trending Topics
    (28)

  • IoT (Internet of Things)
    (387)

  • Java
    (1,247)

  • Kotlin
    (8)

  • Linux Administration
    (389)

  • Machine Learning
    (337)

  • MicroStrategy
    (6)

  • PMP
    (423)

  • Power BI
    (516)

  • Python
    (3,188)

  • RPA
    (650)

  • SalesForce
    (92)

  • Selenium
    (1,569)

  • Software Testing
    (56)

  • Tableau
    (608)

  • Talend
    (73)

  • TypeSript
    (124)

  • Web Development
    (3,002)

  • Ask us Anything!
    (66)

  • Others
    (1,929)

  • Mobile Development
    (263)

Subscribe to our Newsletter, and get personalized recommendations.

Already have an account? Sign in.

Понравилась статья? Поделить с друзьями:
  • Error no pduapi module found
  • Error no parameter defined эцп
  • Error no override and no default toolchain set
  • Error no objects specified in config file problems making certificate request
  • Error number 0x8000ffff