20.4 C
New York
Sunday, April 2, 2023

Flutter: How to Repair/Remove all Dependencies in .pub-cache

If you are developing an app using Flutter and have encountered a problem related to one or more packages being broken in the system cache (in the ./pub-cache folder), you can reinstall all your cached dependencies by executing the command below:

flutter pub cache repair

Screenshot:Advertisements

This process can take from a few tens of seconds to several tens of minutes, depending on the number of packages to download and your internet speed.

If you want to delete all cached packages to get more free disk space or solve some problems, run the following command:

flutter pub cache clean

YouÂ’ll be asked to confirm your decision:

AdvertisementsType “Y” to continue:

As of now, youÂ’ll have to run flutter pub get in your projects to install the plugins you are using.

ThatÂ’s it. Further reading:

You can also check out our Flutter category page or Dart category page for the latest tutorials and examples.

Advertisements

Related Articles

Latest Articles