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

1,343

Solution 1

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

Solution 2

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 :).

Share:
1,343
Anas Yousuf
Author by

Anas Yousuf

Native Android Developer and Hybrid Flutter Developer.

Updated on December 28, 2022

Comments

  • Anas Yousuf
    Anas Yousuf over 1 year

    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

  • Anas Yousuf
    Anas Yousuf over 3 years
    as i said, putting any command of flutter on terminal makes it crash after starting "Building flutter tool" and then the above image mentioned crash. just now i write "flutter downgrade 1.22.6" Entered and the same crash again