【问题标题】:Getting Error of "Connection Timed Out" and "OS Error"出现“连接超时”和“操作系统错误”的错误
【发布时间】:2021-07-19 12:07:10
【问题描述】:
Launching lib\main.dart on Gorgeo 4GL in debug mode...
lib\main.dart:1
√  Built build\app\outputs\flutter-apk\app-debug.apk.
V/PhoneWindow(10971): DecorView setVisiblity: visibility = 0, Parent = ViewRoot{4b712b0 com.example.thesocial/com.example.thesocial.MainActivity,ident = 0}, this = DecorView@b80e062[MainActivity]
D/Surface (10971): Surface::connect(this=0x8b962000,api=1)
D/Surface (10971): Surface::connect(this=0x8b8fd000,api=1)
Connecting to VM Service at ws://127.0.0.1:52475/qaS-Qs8zk5w=/ws
I/zygote  (10971): Do partial code cache collection, code=18KB, data=30KB
I/zygote  (10971): After code cache collection, code=18KB, data=30KB
I/zygote  (10971): Increasing code cache capacity to 128KB
I/zygote  (10971): Do partial code cache collection, code=61KB, data=61KB
I/zygote  (10971): After code cache collection, code=61KB, data=61KB
I/zygote  (10971): Increasing code cache capacity to 256KB
I/flutter (10971): http://10.0.2.2:8000/user/signup
I/flutter (10971): SocketException: OS Error: Connection timed out, errno = 110, address = 10.0.2.2, port = 56162

得到这个错误: I/flutter (10971): SocketException: OS Error: Connection timed out, errno = 110, address = 10.0.2.2, port = 56162

【问题讨论】:

  • 请检查您的网络连接或您的真实设备或模拟器 wifi 或互联网是否正常 将此行添加到 android\app\src\main\AndroidManifest.xml 文件
  • 我应该在哪个标签中添加这一行?
  • 添加 这一行在 标签开始上方的 标签内或见我的回答
  • 又出现同样的错误。
  • 非常感谢@Ravindra S. Patil 的讨论。我在模拟器中试了一下,效果很好。我认为它不适用于真实设备。我想我是因为愚蠢的理由浪费了你的时间。非常感谢您的帮助。

标签: postgresql flutter dart


【解决方案1】:

你应该试试这个:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.shop_app">
   <uses-permission android:name="android.permission.INTERNET" />
    <application>

【讨论】:

    猜你喜欢
    • 2021-04-18
    • 1970-01-01
    • 2012-05-24
    • 2018-10-26
    • 2020-07-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多