4

I am trying to run a Flutter for web project, which was working just fine, until I ran flutter packages run, after which webdev serve gives the error above. My project is located in a different directory, E:\Flutter_web_try to be specific, which has a pubspec.yaml file.

I have already tried flutter pub pub packages get, reinstalling flutter, deactivating and reactivating webdev but none of those have worked. No new flutter_web project I create is running either, and throws the same error. I have also tried installing a fresh version of Flutter, with the env variables changed, but still the error remained the same.

webdev could not run for this project.
Could not find a file named "pubspec.yaml" in "C:\Users\Sanchit\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\protobuf-0.13.12".```

It should run properly, and tell me the default port at which the project is being served on, which it did before the flutter packages get command.
4
  • 3
    Try using flutter packages pub global run webdev serve in your terminal and tell us the output. Commented Jun 22, 2019 at 16:21
  • No active package webdev. pub finished with exit code 65 Commented Jun 22, 2019 at 16:28
  • Try using pub global activate webdev to activate the package. Commented Jun 22, 2019 at 16:30
  • Was already active, ran this command, still gives the same error Commented Jun 22, 2019 at 17:28

2 Answers 2

3

You're having that issue because your webdev path is not setup correctly. If you still want to run your web app, go to that path and execute:

flutter packages pub global run webdev serve

Same thing if you want to build your web app to release:

flutter packages pub global run webdev build

be sure to finish your webdev serve (control + c) before building or is not going to work.

Sign up to request clarification or add additional context in comments.

Comments

0

Try running this command in your project directory.

pub get

It will install all missing dependencies. In your case protobuf-0.13.12.

4 Comments

E:\FlutterAppDev\flutter for web\flutter_web_try>pub get Resolving dependencies... Git error. Command: git fetch fatal: not a git repository (or any of the parent directories): .git Happens even after placing it inside a git repository, git init, git clone
This is another question. What do you think is the relationship between pub and git. The correct answer is that there is no relationship between them.
I am using flutter for web, and therefore in the pubspec.yaml files, there are a few a dependencies based on github, therefore pub need git.
I know. I use the same. Everything works as expected. As the temporary solution you can create new project and see is there any similar errors in it. If everything will work as expected then problem only in your current project.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.