Reputation: 31
java.net.UnknownHostException: Unable to resolve host "xyz.com": No address associated with hostname
I found this issue,While trying to fetch data through web service. I have given "INTERNET" permission in manifest. also my WiFi connection works fine. This issue is not often, Sometime this hostname works and I will get data through same web service, but sometime it give this error.
Upvotes: 3
Views: 5990
Reputation: 2699
You just need to take into consideration that if you are working with an emulator, either Android Studio's Android Emulator or Genymotion Emulator, you just need to restart it if you have been working with it and you haven't restarted it after a wake up from your computer.
TL;DR -> every time you leave an emulator session open even after an hibernation of your computer and you need to work with Internet, it's highly recommended to restart the emulator to avoid spending time trying to debug the problem.
Upvotes: 5