Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter packages get does not install new package

I'm trying to install a package (dynamic_theme) in flutter. When I run flutter packages get -v it does not even try to install the package.

So far I've tried:

  • Running flutter packages get
  • Running flutter packages get
  • Restarting my computer
  • Updated flutter
  • Added another package but that did not install either
  • Updated Android Studio

In my pubspec.yaml I've put:

dependencies:
  flutter:
    sdk: flutter
  firebase_core:
  cupertino_icons: ^0.1.2
  dynamic_theme: ^1.0.1 # the package does not install
  uuid: 2.0.0 # the package does not install

In the logs for the verbose run of flutter packages get where it installs the packages it outputs:

[ +422 ms] Running "flutter packages get" in quiz_app... (completed in 0.4s)
[  +57 ms] Found plugin firebase_core at E:\Other\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.3.4\
[  +13 ms] Found plugin shared_preferences at E:\Other\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.2\
[ +141 ms] Found plugin firebase_core at E:\Other\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\firebase_core-0.3.4\
[   +6 ms] Found plugin shared_preferences at E:\Other\SDKs\flutter\.pub-cache\hosted\pub.dartlang.org\shared_preferences-0.5.2\
[  +26 ms] "flutter get" took 718ms.

I expected that flutter downloaded and installed the packages, but it does just check for updates on the already installed packages like firebase_core.

like image 573
Alve Avatar asked Apr 20 '19 08:04

Alve


3 Answers

Close and open your editor. Worked for me ;)

like image 181
Sebastián Lara Avatar answered Oct 18 '22 02:10

Sebastián Lara


so basically run:

flutter clean

flutter packages get

flutter packages upgrade

Restart Android Studio or Visual Studio

you can restart VSC by:

ctrl + shift + P and then a search bar will appear and then type: "restart" and smash the Enter key.

like image 32
Neil Rodriguez Avatar answered Oct 18 '22 01:10

Neil Rodriguez


hi I have a similar problem I deleted a package from the dart packages folder and when I run flutter pub run it won't download and work so I tried all the way people said but something worked for me is I tried to repairing pub cache and it worked just run

flutter pub cache repair
like image 15
reza47 Avatar answered Oct 18 '22 02:10

reza47