扑扑酒吧卡住了 [英] flutter pub get is stucking

查看:81
本文介绍了扑扑酒吧卡住了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在终端 flutter pub get 中运行时,它显示了

OS MacOS Catalina 10.15.3

 尝试在https://pub.dartlang.org上找到包launch_review时出现TLS错误.pub失败(服务器不可用)-尝试在1秒内重试1 ...尝试在https://pub.dartlang.org上找到包launch_review时发生套接字错误.pub失败(服务器不可用)-尝试在2秒内重试2 ...尝试在https://pub.dartlang.org上找到包launch_review时遇到TLS错误.pub失败(服务器不可用)-尝试在4秒内重试3 ...尝试在https://pub.dartlang.org上找到包launch_review时发生套接字错误.pub失败(服务器不可用)-尝试在8秒内重试4 ...尝试在https://pub.dartlang.org上找到包launch_review时发生套接字错误. 

解决方案

说明前的快速修复:

  • 重新启动路由器!为我工作了好几次.
  • 确保您的网络不在代理之后
  • 确保您可以 ping pub.dev 而不会丢失任何数据包
  • 尝试重新执行 flutter pub get
  • 之前,关闭所有dart.exe进程.
  • 尝试从 pubspec.yaml 中删除现有程序包,然后重新获取它以查看其是否有效
  • 尝试

  • 打开您的任务管理器,然后查找最新的dart.exe任务(应在 flutter pub获取时立即调用它.此任务是正在下载的软件包.如果看到了进程大小从未超过特定大小,并且get命令仍然卡住,它仅表示网络问题,并且该软件包可能永远无法成功下载,例如,我尝试获得carousela_flutter 1.4.1软件包的过程最终被暂停大小约为60mb,看起来是这样的:
  • 如果您等待相对较长的时间(我想说10分钟就足够了),而连通性问题仍未解决,则您会看到以下消息:"进程已完成,退出代码为0 ".

    我建议您再试一次或小心地添加软件包.

    p.s:并非所有软件包都发生这种情况,从我的调查看来,这似乎与它的大小有关.例如,我设法获得了carousela_flutter 0.7.0程序包,但1.4.1失败了.

    When I run in terminal flutter pub get is stuck it's showing

    OS MacOS Catalina 10.15.3

    Got TLS error trying to find package launch_review at https://pub.dartlang.org.                                    
    pub get failed (server unavailable) -- attempting retry 1 in 1 second...                                           
    Got socket error trying to find package launch_review at https://pub.dartlang.org.                                 
    pub get failed (server unavailable) -- attempting retry 2 in 2 seconds...                                          
    Got TLS error trying to find package launch_review at https://pub.dartlang.org.                                    
    pub get failed (server unavailable) -- attempting retry 3 in 4 seconds...                                          
    Got socket error trying to find package launch_review at https://pub.dartlang.org.                                 
    pub get failed (server unavailable) -- attempting retry 4 in 8 seconds...                                          
    Got socket error trying to find package launch_review at https://pub.dartlang.org.                              
    

    解决方案

    Quick fixes before explanation:

    • Restart your router! Works for me several times.
    • Make sure your network is not behind a proxy
    • Make sure you can ping to pub.dev without any packet loss
    • Try to close all of your dart.exe processes before retying to perform the flutter pub get
    • Try to delete an existing package from your pubspec.yaml and re-get it to see if it works
    • Try to manually add the package to your project

    So, I had (and sometime still having) the same issue. I've analyzed it and came to a conclusion that the package download manager and the server that hosts those packages aren't reliabe at all. Very small packages might just successfully be imported with "flutter pub get", whereas big ones might last forever to download. This is definately a networking issue, on either yours or their side.

    Just for verificatioin that we are indeed experiencing the same issue:

    1. open your cmd (no matter t OS) and run: ping -t pub.dev .Now, if you see those inconsitent replies from the server, it means there's something wrong with the network (yours or their side). This looks something like this:

    2. Open up your task manager and look for the latest dart.exe task (it should be invoked the moment you flutter pub get. This task is the package that is being downloaded. If you see the process size never exceeding a certain size, and the get command is still stuck, it only indicates a network issue and the package might never be downloaded successfully. For example, my attempts to get the carousela_flutter 1.4.1 package ended up with a halted process size of around 60mb, looks this this:

    If you wait for a relatively large amount of time (10 minutes I would say is enough) and the connectivity issue is still not resolved, you will see the following msg from flutter: "Process finished with exit code 0".

    I suggest you try another time or maually add the package.

    p.s: it doesn't happen with all of the packages and from my investigation is seems to be related to the size of it. e.g, I managed to get the carousela_flutter 0.7.0 package, but the 1.4.1 failed.

    这篇关于扑扑酒吧卡住了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆