15

I dowloaded a Flutter sample code for Catalog from git, which showing me a warning,

'package get' has not been run
'Pub get' has not been run

What does it mean? How to solve it? Should I ignore this warnings or Update dependencies as suggested with links in warning?

enter image description here

17 Answers 17

23

Dart is similar to node. It has a pubspec.yaml which is the equivalent of package.json containing your dependencies and stuff.

And you need to download these dependencies, using pub get. Or on the case of flutter, using flutter packages get.

This warning is just here to reminds you that your dependencies aren't downloaded

=> Click on Get Dependencies of the first warning

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

7 Comments

i clicked in get dependencies but problem remains same
In my case, the warning still show after clicked Get Dependencies and process finished. So I try reload project and warning gone.
I clicked in get dependencies but problem remains same until I restarted the Android Studio.
I deactivate the Dart support, so that Flutter can work
|
11

The banner 'Pub get' has not been run did not disappear even after I clicked Get dependencies and Upgrade dependencies.

Then, after I closed Android Studio and opened the same project again, the banner disappeared.

3 Comments

Seems like bug..!
Thank you! This answer saves me a lot of time before I even start to find out why this is happening.
To me, it shows up whenever I start the Android studio and it never disappears until I click the Ignore button.
8

Just restart Android Studio or Your IDE, it worked for me also. Or Run flutter upgrade in terminal.

Comments

3

when clicks on Get Dependencies but doesn't work. All you need to do is:-

1- Go to pubspec.yaml

2- click a Pub get

in the toolbar

3- congratulations! done does work now :D

Comments

2

Reopen the project if the error does not disappear even after downloading dependences.

1 Comment

Welcome to StackOverflow, add some more description and code if it's required to understand the answer because it will resolve someone's else problem ASAP.
2
  1. Click Get dependencies and wait for it to finish.
  2. Restart Android Studio

2 Comments

where is 'get dependencies'?
You can find it in the upper Right of the IDE , Android Studio
2

This is for anyone who clicks on Get Dependencies but doesn't work. All you need to do is:

Step 1: Go to terminal and type flutter upgrade

Step 2: Go to File -> Invalidate Caches/Restart -> click Restart

Step 3: Now just click Get Dependencies

That will do the job.

Comments

1

Click on the 'Get dependencies' on the banner 'pub get', then the banner will disappear an the dependencies will get downloaded and the errors will disappear. If still the errors remain then restart Android Studio and try. It worked for me.

Comments

1

enter image description hereWhen I face that error, actually I found out that I am in another subfolder. The solution is really easy to delete an extra folder or just cd that subfolder and run "flutter pub get" command. ... Sorry for my bad English!

Comments

1

I tried all solution in this post but nothing help even reopen IDE. Finally I have no choice but click the Ignore button:

enter image description here

This is the last way... Maybe it's a bug of IDE.

So take it easy and just click Ignore button when you had execute pub get.

Note: My projects all work well.

Comments

1

Update your plugins/externals by restarting android studio. It asked for that and then it all worked.

1 Comment

Please don't add "thank you" as an answer. Once you have sufficient reputation, you will be able to vote up questions and answers that you found helpful. - From Review
1

if nothing works even after clicking on Get Dependencies and restarting update your android studio IDE that will work

Comments

1

Try setting your Dart entrypoint. Go to File -> Run -> Profile -> Edit Configurations -> New configuration (+ on the top left) -> Flutter and set the Dart entrypoint to your main.dart file. For example:

AndroidStudioProjects/project_foo/lib/main.dart

Then set a device and run the project. The dependencies should resolve automatically.

Comments

1

For me, it was happening on the local packages in my project, and clicking on Get dependencies was not working.

The reason is that Get dependencies on the banner runs the flutter pub get on the main root of the project, not that specific package. So the fix would be:

  1. Open the Terminal and navigate to each package directory (where you can find the pubspec.yaml for that package) using cd package_name
  2. Run flutter pub get
  3. Do it for all your local packages

Comments

1

This error is uccered when your flutter sdk and dart sdk werent matched, so by disabling both plugins in android studio and enable only the flutter plugin, this problem will be solved.

2 Comments

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.
@Bot cringe type ahh comment
0

Just open the Terminal and run :

flutter upgrade

1 Comment

This does not even remotely answer the question, nor this should be done
-1

This is the correct way i am try it , It works normally

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.