How to solve SocketException: Failed host lookup: 'www.xyz.com' (OS Error: No address associated with hostname, errno = 7)

后端 未结 21 2090
耶瑟儿~
耶瑟儿~ 2020-12-09 07:50

Whenever I try to do an http call after about 20 seconds I get in the console the following error:

E/flutter ( 8274): [ERROR:flutter/shell/common/shell.cc(1         


        
相关标签:
21条回答
  • 2020-12-09 08:19

    Make sure your Emulator or your device connected to the internet. if your Emulator could not connect to the internet use a VPN.

    0 讨论(0)
  • 2020-12-09 08:20

    If you are getting this error while using the flutter_socket_io plugin, don't forget to initialize the socket i.e socketIO.init(); socketIO.connect(); before attempting to subscribe to it. I received the same error as that indicated above when I omitted it.

    0 讨论(0)
  • 2020-12-09 08:23

    Also, might good to look at the 'Proxy settings' inside the 'Extended controls' of the emulator.

    The way it worked for me was to change to use the 'No Proxy' setting.

    0 讨论(0)
  • 2020-12-09 08:24

    I had the same problem while running the app on an emulator.

    My laptop was connected to the internet through my phone's mobile hotspot. But apparently the emulator was unable to access the internet

    Later, I switched to my Wi-Fi Router connection and the application proceeded smoothly as expected.

    I'm not sure, but is there any special access to be granted?

    Tip: Try googling something on the emulator to check internet connectivity

    0 讨论(0)
  • 2020-12-09 08:25

    When i enabled wifi on my device, it worked fine.

    0 讨论(0)
  • 2020-12-09 08:26

    If you are using an emulator make sure that the mobile data is active

    0 讨论(0)
提交回复
热议问题