Reputation: 1857
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)?
the above initializing was shown for 4 hours. What may be the issue? Can anyone please help with this
Upvotes: 4
Views: 5875
Reputation: 285
I fixed that by:
flutter/bin
directory.flutter pub cache repair
.flutter doctor
Upvotes: 4
Reputation: 11637
The flutter tool is fundamentally broken. It cannot reliably do an upgrade. It is a mix of Bash, BAT & Powershell scripts, which are very cryptic and fragile. They can fail due to various reasons, including permissions, bad internet connection, disk space etc. The scripts fail to provide meaningful error messages. What on earth is The system cannot find the path specified.? What path? Then they run an endless loop trying to somehow magically 'fix' the issue.
To avoid these issues, download the full Flutter SDK to a chosen directory, unzip it, and update the PATH accordingly yourself. The Flutter SDK contains also the Dart SDK.
Also one gotcha. If you have multiple Flutter installations, be sure to run the
flutter from outside the bin directory like so: bin\flutter doctor
. You may accidentally run flutter from a different location.
Upvotes: 0
Reputation: 154
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'
Upvotes: 0
Reputation: 14775
Try below steps hope its help to you:
flutter/bin
directoryflutter doctor
Upvotes: 1