简体   繁体   English

:java.net.UnknownHostException:无法解析主机“hosturl”:没有与主机名关联的地址

[英]: java.net.UnknownHostException: Unable to resolve host “hosturl”: No address associated with hostname

I have android application which connect to "hosturl" over the web. 我有android应用程序通过Web连接到"hosturl" This application can connect to hosturl in the initial steps, but after i try to test it for some time(say 20 or more requests), I get above exception and I can not no longer connect to above url. 这个应用程序可以在初始步骤中连接到hosturl ,但在我尝试测试它一段时间后(比如20个或更多请求),我得到了异常,我不能再连接到上面的url了。

If i restart my android handset, then application can again connect to the "hosturl" but again I get the exception after I have tried to connect to hosturl few number of times 如果我重新启动我的Android手机,那么应用程序可以再次连接到"hosturl"但是在我尝试连接到hosturl的次数之后我再次获得异常

Could anybody help me here If you have encounter such a behavior with an android application before. 任何人都可以帮助我吗?如果你之前遇到过Android应用程序的这种行为。

You probably don't have the INTERNET permission. 您可能没有INTERNET权限。 Try adding this to your AndroidManifest.xml file, right before </manifest> : 尝试在</manifest>之前将其添加到AndroidManifest.xml文件中:

<uses-permission android:name="android.permission.INTERNET" />

我遇到了这个,我刚关闭了我的AVD并再次启动它并且它有效...

Check your Internet connection. 检查您的Internet连接。 Check Wifi. 检查Wifi。 Check Server. 检查服务器。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.net.UnknownHostException:无法解析主机没有与主机名关联的地址 - java.net.UnknownHostException: Unable to resolve host No address associated with hostname 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 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:无法解析主机“<url> &quot;: 没有与主机名和字符 0 处的输入结束关联的地址 - java.net.UnknownHostException: Unable to resolve host "<url>": No address associated with hostname and End of input at character 0 of 非严重异常:java.net.UnknownHostException无法解析主机“ mysite.com”:没有与主机名关联的地址 - Non-fatal Exception: java.net.UnknownHostException Unable to resolve host “mysite.com”: 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 java.net.UnknownHostException无法解析主机“accounts.google.com”:在bigquery中插入行时没有与主机名关联的地址 - java.net.UnknownHostException Unable to resolve host “accounts.google.com”: No address associated with hostname while inserting rows in bigquery java.net.UnknownHostException:无法解析主机“api.themoviedb.org” - java.net.UnknownHostException: Unable to resolve host "api.themoviedb.org 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
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM