Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Update flutter dependencies in /.pub-cache

I erased in my folder .pub-cache/hosted/pub.dartlang.org/this_plugin

What is the command to update the dependencies inside pubsec.yaml? I believe it is

flutter packages get

The folder under .pub-cache is still not up to date.

Note: there was a pubspec.lock that I deleted

like image 689
Raymond Chenon Avatar asked Mar 28 '19 13:03

Raymond Chenon


People also ask

How do I update my pub in flutter?

To upgrade to a new version of the package, for example to use new features in that package, run flutter pub upgrade (Upgrade dependencies in IntelliJ or Android Studio) to retrieve the highest available version of the package that is allowed by the version constraint specified in pubspec. yaml .

Where is flutter pub cache folder?

By default, this directory is located under . pub-cache in your home directory (on macOS and Linux), or in %LOCALAPPDATA%\Pub\Cache (on Windows). (The precise location of the cache may vary depending on the Windows version.)

What is flutter pub cache repair command?

$ dart pub cache repair. This command can be useful when packages in your system cache are somehow changed or broken. For example, some editors make it easy to find implementation files for packages in the system cache, and you might accidentally edit one of those files.


2 Answers

Disclaimer: By running the command below, have a really fast internet connection or be ready to lose one hour of productive hours. ( it will redownload every package every installed on your pc, and I mean each and all of the versions of each packages)~TSR

flutter pub cache repair 

or delete /Users/xxxxxxx/development/tools/flutter/.pub-cache/hosted/pub.dartlang.org/cloud_firestore-0.8.2+3/ and run flutter packages get again.

if all the above things fail delete the cache folder or also check the version updated in the lock file (some time lock give me the problem with updating the version number)

PS: Why flutter pub cache repair download every package version previously used?

like image 152
LOG_TAG Avatar answered Oct 04 '22 13:10

LOG_TAG


Remove the package from dependencies in pubspec.yaml, run flutter packages get. And then add the package to dependencies again and running flutter packages get.This process has solved the problem for me in the past.

like image 28
Mazin Ibrahim Avatar answered Oct 04 '22 12:10

Mazin Ibrahim