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

Krunal
  • 77,632
  • 48
  • 245
  • 261

13 Answers13

24

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

Rémi Rousselet
  • 256,336
  • 79
  • 519
  • 432
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.

Henry Ning
  • 111
  • 1
  • 6
7

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

simplygk
  • 91
  • 1
  • 4
2

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

vinaytejab
  • 51
  • 4
  • 1
    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. – Nensi Kasundra May 12 '20 at 10:56
2
  1. Click Get dependencies and wait for it to finish.
  2. Restart Android Studio
double-beep
  • 5,031
  • 17
  • 33
  • 41
Fars Fuad
  • 21
  • 1
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.

1

Just open the Terminal and run :

flutter upgrade

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.

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!

Blue Phoenix
  • 153
  • 11
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.

无夜之星辰
  • 5,426
  • 4
  • 25
  • 48
1

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

TarHalda
  • 1,050
  • 1
  • 9
  • 27
Stinni
  • 11
  • 2
  • Please don't add "thank you" as an answer. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation), you will be able to [vote up questions and answers](https://stackoverflow.com/help/privileges/vote-up) that you found helpful. - [From Review](/review/late-answers/33109239) – Femn Dharamshi Nov 10 '22 at 02:42
0

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

-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

Franz Andel
  • 1,326
  • 12
  • 20