java - Unable to resolve host "<URL here>" No address associated with host name

ID : 20340

viewed : 1

Tags : javaandroidjava

Top 5 Answer for java - Unable to resolve host "<URL here>" No address associated with host name

vote vote

96

You probably don't have the INTERNET permission. Try adding this to your AndroidManifest.xml file, right before </manifest>:

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

Note: the above doesn't have to be right before the </manifest> tag, but that is a good / correct place to put it.

Note: if this answer doesn't help in your case, read the other answers!

vote vote

90

I've seen this problem in the emulator as well. In my case, it is caused by launching the emulator, then putting the computer to sleep or changing the network connection (going from work to home, etc), then attempting to use the same emulator again. Closing and re-launching the emulator resolves the problem in this case.

vote vote

73

It is WiFi bug due to wifi disable or not properly connected.

Simply Reconnect the wifi will solve the issue.

vote vote

64

Unable to resolve host “”; No address associated with hostname

you must have to check below code here on your manifest :

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

and most important at least for me:-

enabled wifi connection or internet connection on your mobile device

vote vote

57

Sometimes, although you add <uses-permission android:name="android.permission.INTERNET" /> in the AndroidManifest and you have a WiFi connection, this exception can be thrown. In my case, I have turned off WiFi and then turned it on again. This resolved the error. Weird solution, but sometimes it works.

Top 3 video Explaining java - Unable to resolve host "<URL here>" No address associated with host name

Related QUESTION?