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.
在调试的时候发生如下错误:
java.net.UnknownHostException: Unable to resolve host "xxx": No address associated with hostname
原因是从wifi状态下,切换到没有网络的环境下,然后出现了上述的错误。