【问题标题】:How to fix 'HttpException' error while running flutter app on an Android Emulator with Android Q?如何在使用 Android Q 的 Android 模拟器上运行颤振应用程序时修复“HttpException”错误?
【发布时间】:2019-06-08 04:36:53
【问题描述】:

我正在尝试在 Android Q 上运行的 Android Emulator 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 问题和 Stackoverflow 上找到的解决方案,我还尝试将 NO_PROXY=localhost,127.0.0.1 添加到 .bash_profile

【问题讨论】:

    标签: android flutter android-10.0


    【解决方案1】:

    对于 android 模拟器,请使用 10.0.2.2 而不是 127.0.0.1。所以试试http://10.0.2.2/YLIiMby5lk4=/ws
    如果您使用的是real device,请将其替换为您的Computers Ip address

    【讨论】:

    • 我确实将 .bash_profile 更改为 NO_PROXY=localhost,10.0.2.2 但没有用。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-09
    • 2021-08-24
    • 2021-10-19
    • 2016-09-04
    • 2019-05-31
    • 2021-09-26
    相关资源
    最近更新 更多