[英]Android 6.0 : java.net.UnknownHostException: Unable to resolve host. Working fine in Android 7.0
There is issue of java.net.UnknownHostException: Unable to resolve host "URL": No address associated with hostname 存在java.net.UnknownHostException问题:无法解析主机“ URL”:没有与主机名关联的地址
Here is what I tried. 这是我尝试过的。
Above solutions is working fine in Android 4.4.4, 6.0, and also 7.0. 上述解决方案在Android 4.4.4、6.0和7.0中都可以正常工作。
But this is not working only on 6.0. 但这不仅适用于6.0。
After several attemps I found unreadable characters when setting the URL at my code. 几次尝试后,在代码中设置URL时发现不可读的字符。 Opening the source file with VIM, I found: http://this.is.an.ip <200b> /
用VIM打开源文件,我发现: http://this.is.an.ip <200b> /
Where <200b> is an unreadable character at my IDE (Android studio). 其中<200b>是我的IDE(Android studio)上不可读的字符。
After the deletion of <200b> my app started running ok at Android 5/6. 删除<200b>后,我的应用在Android 5/6上开始正常运行。
Good luck! 祝好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.