【问题标题】:Bad state: Future already completed in Flutter坏状态:Future 已经在 Flutter 中完成
【发布时间】:2021-03-13 16:57:33
【问题描述】:

我在 Big Sur 上使用任何颤振命令都会收到此错误:

Bad state: Future already completed
#0      _AsyncCompleter.complete (dart:async/future_impl.dart:43:31)
#1      _NativeSocket.startConnect.<anonymous closure>.connectNext.<anonymous closure> (dart:io-patch/socket_patch.dart:682:23)
#2      _NativeSocket.issueWriteEvent.issue (dart:io-patch/socket_patch.dart:1102:14)
#3      _NativeSocket.issueWriteEvent (dart:io-patch/socket_patch.dart:1109:12)
#4      _NativeSocket.multiplex (dart:io-patch/socket_patch.dart:1130:11)
#5      _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:168:12)
Error: Unable to 'pub upgrade' flutter tool. Retrying in five seconds... (6 tries left)

我唯一改变的是安装 AdGuard,但我完全删除了它。现在我尝试了不同的方法来修复它后无法摆脱这个错误。

我也有 Bitdefender,但不认为这是相关的,因为我从一开始就安装了这个(这也是我公司的要求,我不能在这里修改任何东西)

【问题讨论】:

标签: flutter


【解决方案1】:

方法一:

尝试使用flutter config --no-analytics。它应该可以正常工作。

Refrence.

方法2:

如果您使用第三方防病毒程序,请尝试卸载并重新安装该程序或停用 Web Shield(Core Shields)上的“扫描安全连接”选项

【讨论】:

  • 这是我尝试过但没有成功的方法之一。重新启动 IDE、笔记本电脑和一切
  • 关于杀毒,AdGuard 被删除,Bitdefender 被我公司屏蔽了,无法修改
  • 如果我将整个颤振文件夹替换为最新的文件夹(我使用的是 1.22.6),则命令可以工作,但是命令永远需要,然后他们说“错误:无法'发布升级'颤振工具。五秒钟后重试...(还剩 9 次尝试)”。所以目前我不能使用这个版本,使用最新的
  • 我也尝试了一些 VPN(我听说来自中国的颤振开发者也有类似的问题)但没有任何改变
  • 所以要确定你的公司是否禁止了flutter服务器的IP地址@Dani
猜你喜欢
  • 2021-05-05
  • 1970-01-01
  • 1970-01-01
  • 2020-04-18
  • 2021-03-30
  • 2019-01-31
  • 2019-06-24
  • 2018-12-26
  • 1970-01-01
相关资源
最近更新 更多