Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)

Viewed 1286

I am trying for flutter doctor and the following error was shown

Running pub upgrade...
The system cannot find the path specified.
Error (1): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left)

Waiting for 2 seconds, press CTRL+C to quit ...
Terminate batch job (Y/N)?

enter image description here

the above initializing was shown for 4 hours. What may be the issue? Can anyone please help with this

3 Answers

I fixed that by:

  1. Ctrl+C to stop infinite error loop.
  2. Kill the Dart process in Windows Task Manager.
  3. Delete the cache folder located in flutter/bin directory.
  4. Run in command line flutter pub cache repair.
  5. Run flutter doctor

Try below steps hope its help to you:

  1. Go to your flutter directory
  2. Delete cache folder inside flutter/bin directory
  3. Then try to run flutter doctor

First Make sure you have a working internet connection and if this issue still exists then, this error may be because the dart SDK may have not been properly downloaded. The simplest solution is to delete the cache folder located in the flutter/bin(the location where the flutter is installed) and then Run the flutter doctor.

**Also **try turning off your 'Antivirus' and try 'flutter doctor'

Related