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

后端 未结 21 2088
耶瑟儿~
耶瑟儿~ 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:06

    Translated: In my case, the computer had internet, but the emulator did not. I configured the connection on the emulator and solved it.

    Original: No meu caso, o computador estava com internet, porém o emulador não. Configurei a conexão no emulador e resolveu.

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

    By enabling WIFI it works for me, and make sure you also added the internet permission in the android manifest it added automatically also but you have to make sure. if still not then invalidate caches and restart hope it works

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

    Sometimes, other wifi can have interference with your connected wifi, which can cause this error as well. Try to set your connected wifi's channel to auto or away from other wifi's channels.

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

    Even I had the same issue. I restarted my emulator and it worked!!

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

    Adding internet permission is not only a solution.
    You also have to make sure that you are online whether it is mobile or emulator

    1. Make sure you are online whether it is mobile or emulator

    2. Make sure you have given internet permission in your app's android/app/src/main/AndroidManifest.xml

      <uses-permission android:name="android.permission.INTERNET"/>

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

    Make sure your Mobile device or Emulator is connected to the internet

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