1、网上介绍的做法
只要在pubspec.yaml文件最后加上以下两句话:
PUB_HOSTED_URL ===== https://pub.flutter-io.cnFLUTTER_STORAGE_BASE_URL ===== https://storage.flutter-io.cn然后点击Flutter doctor即可,然后再把这两句话删掉,重新 点击Packages get就会成功
Process finished with exit code 02、我自己遇到这个问题的原因:
是因为~/.bash_profile这个文件里面的这两行代码被我注释掉了,去掉注释,然后重启andriod studio 重新 package get 就ok了
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn3、出现flutter指令的时候会出现
Waiting for another flutter command to release the startup lock
解决方法:
删除flutter SDK 下的/bin/cache/lockfile文件重启Android Studio