关于 flutter packages pub publish 出现 Failed to upload the package的解决方案
benjaken opened this issue · comments
Nerochen commented
1.设置终端代理
这里用的proxifier+shadowsock;
具体配置参考终端使用 Shadowsocks 的代理方案:Proxifier
设置后测试
curl www.google.com
有回文则成功
2.关闭国内镜像
vi ~/.bash_profile
// 将以下两行注释掉
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
// 之后让配置生效
source ~/.bash_profile
3.cd到仓库根目录,执行一次
flutter packages get
这时候就会把你的插件里的lock文件中的国内镜像转到官方源上了
4.正常使用
sudo flutter packages pub publish -v
或
flutter packages pub publish --server=https://pub.dartlang.org
即可