[英]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 中的错误:
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:
Open "System Preferences"打开“系统偏好设置”
Click on "Network"点击“网络”
Select the network which your computer is connected and click on "Advanced"选择您的计算机连接的网络,然后单击“高级”
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”
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.