Unable to resolve host “” No address associated with hostname

后端 未结 11 1549
悲&欢浪女
悲&欢浪女 2020-12-07 22:00

I tried following this tutorial: Getting Data from the Web

I tried implementing it on Android 3.0, the latest platform for tablets, however, I get this error: \"

相关标签:
11条回答
  • 2020-12-07 22:17

    Are you able to reach that url from within the built-in browser?

    If not, it means that your network setup is not correct. If you are in the emulator, you may have a look at the networking section of the docs.

    If you are on OS/X, the emulator is using "the first" interface, en0 even if you are on wireless (en1), as en0 without a cable is still marked as up. You can issue ifconfig en0 down and restart the emulator. I think I have read about similar behavior on Windows.

    If you are on Wifi/3G, call your network provider for the correct DNS settings.

    0 讨论(0)
  • 2020-12-07 22:19

    Restarting the emulator works in some scenario.

    0 讨论(0)
  • 2020-12-07 22:25

    if you have USB internet like me the emulator seems to dislike connection being turned on and off so you may need to restart the emulator

    0 讨论(0)
  • 2020-12-07 22:29

    Also, make sure that your device isn't on airplane mode and/or that data usage is enabled.

    0 讨论(0)
  • 2020-12-07 22:29

    I had the same issue with the Android 10 emulator and I was able to solve the problem by following the steps below:

    1. Go to Settings → Network & internet → Advanced → Private DNS
    2. Select Private DNS provider hostname
    3. Enter: dns.google
    4. Click Save

    With this setup, you URL should work as expected.

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