华佗养生网
您的当前位置:首页Running “flutter pub get“ in xxx... 报错: Git error 443

Running “flutter pub get“ in xxx... 报错: Git error 443

来源:华佗养生网

执行 flutter pub get 报错:

我这边出现这种情况是因为引用了 git 库:

k_chart:
  git:
    url: https://github.com/xxx/app_k_chart.git

如果把这个库注释掉,就可以成功执行 flutter pub get

所以现在锁定问题:git 库导致 443。

定位问题后,之后的百度就可以轻松解决了:

开启 git 代理

终端执行(注意把 1087 换成你的端口):

git config --global http.proxy 127.0.0.1:1087
git config --global https.proxy 127.0.0.1:1087

取消 git 代理

如果想取消 git 代理,执行:

git config --global --unset http.proxy
git config --global --unset https.proxy

注:用 Android Studio 的终端还是报错,用 Mac 自带的终端就可以。

题外话:

我最开始用的终端代理:

export http_proxy=http://127.0.0.1:1087;
export https_proxy=http://127.0.0.1:1087;

flutter pub get 还是 443

看来终端代理不能代替 git 代理。

相关参考:

https://www.cnblogs.com/LandWind/p/github_SSL_connect_error_443.html
https:///xhzth70911/article/details/106161214

因篇幅问题不能全部显示,请点此查看更多更全内容