Anas Yousuf
Anas Yousuf

Reputation: 523

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

After updating flutter version from 1 to 2, got unresolveable errors, so deleted all flutter sdk and redownload it using this command git clone https://github.com/flutter/flutter.git -b stable

After this i entered command flutter precache which started downloading Dart Sdk, after that it get crash always...

no matter which command i run flutter doctor or any other, it always starts with Building flutter tool... and then crash.

Also tried other related questions and their answers but no luck...

flutter precache command exceution Image

Flutter and Dart Installed Directory Image

Crash proper image

Upvotes: 2

Views: 2346

Answers (4)

NIKHIL
NIKHIL

Reputation: 21

If you are facing this on the Mac OS BigSur, please install rosetta first.
To do so you can use the following command:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

It worked for me :).

Upvotes: 2

user5218414
user5218414

Reputation: 41

Try delete your flutter sdk folder and checkout it's again.

git clone https://github.com/flutter/flutter.git -b stable

Upvotes: 0

Anas Yousuf
Anas Yousuf

Reputation: 523

Ok so i have filed this issue on flutter github. You can checkout the link https://github.com/flutter/flutter/issues/78167

the answer they told me is: something in the certificate validation is broken on older Mac OS X versions.

Until they resolve issue for older versions of Mac OS. There are two possible solutions:

  1. First is absolutely to upgrade Mac Version but if you have low Ram or Disk switch to solution no.2
  2. Second solution is to downgrade flutter version.

Also like to point out that if you have installed flutter version 2, it won't downgrade to version 1 using command "Flutter Downgrade", atleast this was not working for me so i downloaded older version manually using this link: https://flutter.dev/docs/development/tools/sdk/releases?tab=macos

Upvotes: 0

Edeson Bizerril
Edeson Bizerril

Reputation: 1715

Several packages are not yet fully updated for Flutter 2.0. So I recommend that you continue using Flutter 1.x until everything is resolved. The easiest way is to normally install Flutte 2.0 as if you were going to use it and then downgrade.

To download it, follow this tutorial here: How to downgrade Flutter SDK (Dart 1.x)

When the flutter pub get fails to return the dependencies it gets stuck trying several times. And if you get a pub get via the interface you won't see any errors happening, so I recommend making flutter pub get.

Upvotes: 0

Related Questions