如何在运行 Flutter 应用程序时修复 Android Q 模拟器上的“HttpException”错误?

3

我正在尝试在运行Android Q的Pixel 2模拟器上运行Flutter应用程序,但是命令flutter run会抛出以下错误:

"最初的回答"

Error connecting to the service protocol: HttpException: Connection closed before full header was received, uri = http://127.0.0.1:64350/YLIiMby5lk4=/ws

我尝试重新启动了Android Studio和模拟器。 根据在Github Issues和Stackoverflow上找到的解决方案,我还尝试将NO_PROXY=localhost,127.0.0.1添加到.bash_profile中。

翻译结果:

我尝试过重新启动Android Studio和模拟器。根据在Github问题和Stackoverflow上找到的解决方案,我还尝试将NO_PROXY=localhost,127.0.0.1添加到.bash_profile文件中。

1个回答

0

对于 Android 模拟器,请使用 10.0.2.2 替代 127.0.0.1。所以尝试一下 http://10.0.2.2/YLIiMby5lk4=/ws
如果您正在使用一个 真实设备,请将其替换为您的 计算机 IP 地址


我在.bash_profile中将其更改为NO_PROXY=localhost,10.0.2.2,但没有起作用。 - undefined

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接