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

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

    Check if the wifi is connected or not. Mine worked after restarting the wifi.

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

    The problem is basically coming when device is trying to access any internet resources,to fix add the to AndroidManifest.xml file @android/app/src location.

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

    Double-check / make sure you have

    <uses-permission android:name="android.permission.INTERNET" /> in your app's android/app/src/main/AndroidManifest.xml

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

    Had the same issue. Added uses-permission android:name="android.permission.INTERNET" to "android/app/src/main/AndroidManifest.xml". Still couldn't work, then I quit and restarted the emulator, then it worked.

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

    Go for AVD manager, then choose your emulator, on Actions menu click down option sign, then choose wipe data, then restart your emulator. It works for me.

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

    Even after adding

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

    in your android/app/src/main/AndroidManifest.xml, if you're still finding trouble then

    There maybe an error with the website's server IP address like:

    Server IP address could not be found

    It's better to wait for some time and make sure to restart wifi, it worked for me.

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