flutter - 如何修复 HttpException : Connection closed before full header was received

标签 flutter http https http-headers connection

我最近在我的应用中升级了我的 flutter 版本。但是当我想调试应用程序时,它会显示以下错误。

连接到服务协议(protocol)时出错:HttpException:在收到完整 header 之前连接已关闭,URI = http://127.0.0.1:50795/ws

有没有人在升级flutter版本后遇到同样的问题?如果有任何解决方法,请分享。

最佳答案

现在这个问题在 github 上打开 https://github.com/flutter/flutter/issues/32587

暂时您可以通过切换到物理设备而不是模拟器来解决此问题 How to test android apps in a real device with Android Studio?

在 github 上找到的决定(链接向上)

I've got a temporary work around, which I can use for now. The exception above is thrown when I run the emulator as a Pixel 3 Android 9.+ Target (Q API). I made up a second emulated device, a Pixel 2 Android 9.0 Target (28 API), and this target works fine.

I'm also noticing that the Pixel 2 target takes up 8.5GB on Disk, while the Pixel 3 target only takes up 1.4GB. It makes me wonder if the Pixel 3 target is missing some important things.

关于flutter - 如何修复 HttpException : Connection closed before full header was received,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55879550/

相关文章:

flutter - 启动 flutter 应用程序时,我在哪里运行初始化代码?

Flutter - 在 dispose() 之后调用 setState

flutter - 如何在 flutter math_fork 库的内部表达式中添加自定义值

android - 从 Android 发布到 Ruby on Rails 应用程序

angularjs - 对远程 Sails 服务器的 Angular JS 请求

以编程方式下载 GitHub 私有(private)存储库的 C# 示例

dart - 处理来自 TextField 的数据

http - 为什么 telnet 到端口 80 似乎会访问与 Firefox 不同的服务器?

.htaccess - 通过 htaccess 将一个特殊的 http URL 转发到带端口的 https URL

java - 缓解 Java 中针对 https 请求的 session 劫持