简体   繁体   English

Android 6.0:java.net.UnknownHostException:无法解析主机。 在Android 7.0上正常工作

[英]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. 这是我尝试过的。

  • Turn on/off Wifi 打开/关闭Wifi
  • Test in Mobile Network 在移动网络中测试
  • Check in Postman 签入邮递员
  • Runtime permission integrated 集成了运行时权限
  • INTERNET permission is also there. INTERNET权限也在那里。

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.

相关问题 java.net.UnknownHostException:无法解析主机“@MYIPADDRESS,当使用android + mongodb时 - java.net.UnknownHostException: Unable to resolve host "@MYIPADDRESS, when using android + mongodb 重新启动java.net时android应用程序崩溃。UnknownHostException:无法解析主机 - android app crashes on reboot java.net.UnknownHostException: Unable to resolve host Android API 23 java.net.UnknownHostException:无法解析主机“URL”:没有与主机名关联的地址 - Android API 23 java.net.UnknownHostException: Unable to resolve host “URL”: No address associated with hostname java.net.UnknownHostException:无法解析主机没有与主机名关联的地址 - java.net.UnknownHostException: Unable to resolve host No address associated with hostname Android改装-HTTP失败:java.net.UnknownHostException:无法解析主机{我的基本url}:没有与主机名关联的地址 - Android Retrofit - HTTP FAILED: java.net.UnknownHostException: Unable to resolve host {my base url}: No address associated with hostname Android java.net.UnknownHostException:主机未解析(策略问题) - Android java.net.UnknownHostException: Host is unresolved (strategy question) 无法在android中获取`java.net.UnknownHostException`的堆栈跟踪 - Unable to get stack trace of `java.net.UnknownHostException` in android java.net.UnknownHostException:无法解析主机“ s3-ap-northeast-1.amazonaws.com”:没有与主机名关联的地址 - java.net.UnknownHostException: Unable to resolve host “s3-ap-northeast-1.amazonaws.com”: No address associated with hostname java.net.UnknownHostException:无法解析主机“api.themoviedb.org” - java.net.UnknownHostException: Unable to resolve host "api.themoviedb.org :java.net.UnknownHostException:无法解析主机“hosturl”:没有与主机名关联的地址 - : java.net.UnknownHostException: Unable to resolve host “hosturl”: No address associated with hostname
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM