简体   繁体   English

无法解析 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)

Could not resolve URL " https://pub.dartlang.org ".无法解析 URL“ https://pub.dartlang.org ”。 Error (69): Unable to 'pub upgrade' flutter tool.错误 (69):无法“发布升级”flutter 工具。 Retrying in five seconds... (9 tries left)五秒后重试...(还剩 9 次尝试)

that is the error in flutter when i create or upgrade flutter:这是我创建或升级 flutter 时 flutter 中的错误:

这是我创建或升级 flutter 时 flutter 的错误

What didn't work for me:-什么对我不起作用:-

flutter clean

flutter pub cache repair

And what WORKED!什么有效!

killall -9 dart //THIS STOPPED THE CONTINUE REQUEST

After changing the Wifi/Internet Connection , it worked strangely!更改 Wifi/Internet 连接后,它运行奇怪!

It seems some DNS cache issue (not 100% sure), but I am happy that it worked :)似乎有些 DNS 缓存问题(不是 100% 确定),但我很高兴它有效:)

This would also mean that flutter might not be able to connect to your device if you're trying flutter run onto an Android device.这也意味着如果您尝试在 Android 设备上运行 flutter,flutter 可能无法连接到您的设备。

The solution for this would be to change the DNS address of your network to 8.8.8.8(Google's DNS) or any other address:解决方案是将您网络的 DNS 地址更改为 8.8.8.8(Google 的 DNS)或任何其他地址:

MacOSX: macOS:

  1. Open "System Preferences"打开“系统偏好设置”

  2. Click on "Network"点击“网络”

  3. Select the network which your computer is connected and click on "Advanced"选择您的计算机连接的网络,然后单击“高级”

  4. Select "DNS", Select the "+" button, type "8.8.8.8" (Google's DNS) or if you prefer OpenDNS, "208.67.222.222"选择“DNS”,选择“+”按钮,输入“8.8.8.8”(Google 的 DNS),或者如果您更喜欢 OpenDNS,请输入“208.67.222.222”

  5. Select "Ok" and "Apply"选择“确定”和“应用”

Windows & Linux: https://developers.google.com/speed/public-dns/docs/using Windows 和 Linux: https : //developers.google.com/speed/public-dns/docs/using

After this reopen the terminal and try again.在此之后重新打开终端并重试。

I had run into this problem earlier today!我今天早些时候遇到了这个问题! The thing I discovered was my wifi wasn't working properly and my laptop went to airplane mode.我发现的是我的 wifi 无法正常工作,我的笔记本电脑进入飞行模式。 I would suggest to check the network connection is working or not at that very moment.我建议在那一刻检查网络连接是否正常工作。 And things are more easy to solve than it seems, so chill and keep finding answer with a cool head.事情比看起来更容易解决,所以冷静下来,继续用冷静的头脑寻找答案。 Don't be like me and waste 2 hours of development time.不要像我一样浪费2个小时的开发时间。 Peace.和平。

very simple but your inte.net connection may be broken非常简单,但您的 inte.net 连接可能已断开

it will happen with me when my laptop was not connected to inte.net after connecting it my problem solve当我的笔记本电脑在连接它后没有连接到 inte.net 时,我会发生这种情况我的问题解决了

Try to see if you can reach https://pub.dev/ in your browser尝试查看是否可以在浏览器中访问https://pub.dev/

If it is accessible, declare PUB_HOSTED_URL as a system environment variable and give it the value https://pub.dev/如果可以访问,则将 PUB_HOSTED_URL 声明为系统环境变量并为其赋值https://pub.dev/

Then exit and reopen your cmd window and try again.然后退出并重新打开您的 cmd 窗口并重试。

Occasionally, I switch ISP or use a VPN to connect cause I found out that I can't connect when I use a particular network.有时,我会切换 ISP 或使用 VPN 进行连接,因为我发现使用特定网络时无法连接。

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

相关问题 Flutter 调试 /root/.pub-cache/hosted/pub.dartlang.org 包中的编译错误 - Flutter debug compilation error from /root/.pub-cache/hosted/pub.dartlang.org packages 等待另一个 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 Pub 完成,退出代码为 69 - Pub finished with exit code 69 如何解决 Flutter Pub get Failed 错误 - How to solve Flutter Pub get Failed error `flutter pub get` 导致构建运行器错误 - `flutter pub get` results in build runner error flutter pub get 卡住了 - flutter pub get is stucking 我在我尝试过的 flutter 代码中遇到了这些错误(flutter clean - flutter pub get - flutter 升级 - 缓存修复)所有这些都不起作用 - I got these error in my flutter code I've tried (flutter clean - flutter pub get - flutter upgrade - cache repair) all of it didn't work flutter 路径错误 PATH="$PATH":"$HOME/.pub-cache/bin" - flutter path error PATH="$PATH":"$HOME/.pub-cache/bin" 为什么 flutter 在 pub get 后给我一个退出错误 66? - Why is flutter giving me an exit error 66 after pub get? 为 Flutter & Pub 设置 Android minSdkVersion - Set Android minSdkVersion for Flutter & Pub
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM