Search code examples
androidhostsunknown-host

UnknownHostException when run on device


I got an UnknownHostException when I run the app on the device. When in the emulator, it was fine. I did the configuration of the server and hosts file thing. But I dont know if I have to do it again. Please, any advice would be appreciated. Thanks!


Solution

  • I was able to solve the problem. Restarting the avd, copying the hosts file to the android emulator, adding the internet permission. Then the problem was solved.