简体   繁体   English

尝试在 https://pub.dartlang.org 查找 package cupertino_icons 时出现套接字错误

[英]Got socket error trying to find package cupertino_icons at https://pub.dartlang.org

Whenever i try to create a new project in flutter through git bash or command prompt, i keep on getting this error Got socket error trying to find package cupertino_icons at https://pub.dartlang.org.每当我尝试在 flutter 至 git bash 或命令提示符中创建新项目时,我都会收到此错误Got socket error trying to find package cupertino_icons at https://pub.dartlang.org. I have upgraded the flutter sdk to the latest version but still the same problem.我已经把flutter sdk升级到最新版本了,还是一样的问题。 Please how do i solve this issue.请问我该如何解决这个问题。 Thanks谢谢

I would advice anyone that might still be having this problem to TRY the following simply steps:我建议任何可能仍然遇到此问题的人尝试以下简单步骤:

  1. open environment variable settings打开环境变量设置
  2. create a new variable with the name: PUB_HOSTED_URL and its value: https://pub.flutter-io.cn创建一个名称为:PUB_HOSTED_URL 的新变量及其值: https ://pub.flutter-io.cn
  3. create a new variable with the name: FLUTTER_STORAGE_BASE_URL and its value: https://storage.flutter-io.cn创建一个名称为:FLUTTER_STORAGE_BASE_URL 的新变量及其值: https ://storage.flutter-io.cn

This did it for me.这为我做到了。 After spending weeks tryna figure it out.花了几个星期后试着弄清楚。 Would love to save someone the headache i went through.很想拯救某人我经历的头痛。

I have both issues.我有两个问题。 With:和:

  1. Corporate firewall.企业防火墙。 Look here for solution这里解决
  2. Env variables (Win system env vars).环境变量(Win 系统环境变量)。 Create two of them:创建其中两个:

自己花了2个小时,除了之前的设置,检查你的杀毒软件,我的自动阻止了flutter,所以完全禁用你的杀毒软件然后再次尝试运行,希望这对某人有所帮助。

On Linux, this worked for me and for many other people... It should work for you too.在 Linux 上,这对我和许多其他人都有效......它也应该对你有效。

export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn

On windows, you should create an environment variable with:在 Windows 上,您应该创建一个环境变量:

name: PUB_HOSTED_URL
 
value: https://pub.flutter-io.cn

name: FLUTTER_STORAGE_BASE_URL

value: https://storage.flutter-io.cn

I have found that resetting your wifi router works.我发现重置您的 wifi 路由器有效。 It's happened to me twice and it worked after I reset my router.它发生在我身上两次,并且在我重置路由器后它起作用了。

Using a VPN for access to the inte.net did the trick for me.使用 VPN 访问 inte.net 对我有用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 尝试在 https://pub.dartlang.org 上查找包 cupertino_icons 时出现 TLS 错误 - Got TLS error trying to find package cupertino_icons at https://pub.dartlang.org 尝试在 https://pub.dartlang.org 上查找包 english_words 时出现套接字错误 - Got socket error trying to find package english_words at https://pub.dartlang.org 尝试在 https://pub.dartlang.org 上查找包 ABC 时出现 TLS 错误 - Got TLS error trying to find package ABC at https://pub.dartlang.org 等待另一个 flutter 命令释放启动锁; 尝试在 https://pub.dartlang.org 找到 package english_words 时出现套接字错误 - Waiting for another flutter command to release the startup lock ; Got socket error trying to find package english_words at https://pub.dartlang.org 获取 Flutter Cupertino_icons 依赖错误 - Getting Flutter Cupertino_icons dependency Error Flutter 调试 /root/.pub-cache/hosted/pub.dartlang.org 包中的编译错误 - Flutter debug compilation error from /root/.pub-cache/hosted/pub.dartlang.org packages 无法解析 URL“https://pub.dartlang.org”。错误 (69):无法“发布升级”flutter 工具。 五秒后重试……(还剩 10 次尝试) - Could not resolve URL "https://pub.dartlang.org".Error (69): Unable to 'pub upgrade' flutter tool. Retrying in five seconds… (10 tries left) 无法解析 URL“https://pub.dartlang.org”。 错误 (69):无法“发布升级”flutter 工具。 五秒后重试...(还剩 9 次尝试) - Could not resolve URL "https://pub.dartlang.org". Error (69): Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (9 tries left) 我需要在使用Dart包之前将其发布到pub.dartlang.org吗? - Am I required to publish my Dart package to pub.dartlang.org before I use it? 如何估计pub.dartlang.org包的质量? - How to estimate the quality of pub.dartlang.org packages?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM