java.net.UnknownHostException: Unable to resolve host "<url>": No address associated with hostname and End of input at character 0 of java.net.UnknownHostException: Unable to resolve host "<url>": No address associated with hostname and End of input at character 0 of java java

java.net.UnknownHostException: Unable to resolve host "<url>": No address associated with hostname and End of input at character 0 of


I encountered this problem too, reconnecting the WiFi can solve this.

For us ,we can check if the phone can resolve the host to IP when we start application. If it cannot resolve, tell the user to check the WiFi and then exit.

I hope it helps.


If reconnecting the WiFi doesn't work for you, try reboot your device.

This works for me. Hope it helps.


I had the same exception in the simulator (Android Studio on OSX) but connecting to the same URL on the iOS simulator worked fine... Looks like it all stemmed from the fact I'd be running the simulator whilst connected to a personal hotspot for my internet connection and then came back later while connected to wifi and the simulator didn't like the new internet connection for some reason, seems like it thought the old hotspot was the current connection, which was no longer working..

Closing and relaunching the simulator worked!