flutter upgrade 报错424

执行更新:

1
flutter upgrade

报错如下:

This is an unexpected error. Please run

1
pub --trace upgrade --verbosity=error --no-packages-dir

and include the logs in an issue on https://github.com/dart-lang/pub/issues/new
Error: Unable to ‘pub upgrade’ flutter tool. Retrying in five seconds… (1 tries left)
Command ‘pub upgrade’ still failed after 10 tries, giving up.

解决方式:

卸载flutter SDK 重新安装

//配置环境变量

1
vim ~/.bash_profile
1
2
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
1
source .bash_profile

//下载SDK

1
git clone -b dev https://github.com/flutter/flutter.git

//配置SDK的环境变量

1
export PATH="$PWD/flutter/bin:$PATH"

安装

1
2
cd ./flutter
flutter doctor

备注:执行flutter doctor的时候,可能会报上面同样的错误,耐心等待一下,挂梯子,重新执行

xcode工具链有问题的

1
2
3
4
5
6
7
8
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller