Android Studio - Genymotion - Volley获取错误的网址下载

时间:2022-12-20 18:30:07

I'm facing this really strange issue and I couldn't realize what's happening. I have a login activity and when I try to make a request to validate the user information, I get this error in volley:

我正面临这个非常奇怪的问题,我无法意识到发生了什么。我有一个登录活动,当我尝试发出验证用户信息的请求时,我在凌空中收到此错误:

com.android.volley.NoConnectionError: java.net.UnknownHostException: Unable to resolve host "teste.escolaemmovimento.com.br": No address associated with hostname.

com.android.volley.NoConnectionError:java.net.UnknownHostException:无法解析主机“teste.escolaemmovimento.com.br”:没有与主机名关联的地址。

This error only happens when I'm using the Genymotion emulator, I verify the URL field inside of the volley Request object right after create that and after insert the request in the volley queue and the correct url is there. (when I test in the device this error does not happens.)

这个错误只发生在我使用Genymotion模拟器时,我在创建后立即验证了排球请求对象内的URL字段,并在排序队列中插入请求并且正确的URL存在。 (当我在设备中测试时,不会发生此错误。)

LogCat:

06-01 13:17:28.351  25469-25521/br.com.escolaemmovimento D/OpenGLRenderer﹕             Render dirty regions requested: true
06-01 13:17:28.362  25469-25469/br.com.escolaemmovimento D/﹕ HostConnection::get() New Host Connection established 0xabb84990, tid 25469
06-01 13:17:28.374  25469-25469/br.com.escolaemmovimento D/Atlas﹕ Validating map...
06-01 13:17:28.556  25469-25521/br.com.escolaemmovimento D/libEGL﹕ loaded /system/lib/egl/libEGL_emulation.so
06-01 13:17:28.557  25469-25521/br.com.escolaemmovimento D/libEGL﹕ loaded /system/lib/egl/libGLESv1_CM_emulation.so
06-01 13:17:28.568  25469-25521/br.com.escolaemmovimento D/libEGL﹕ loaded /system/lib/egl/libGLESv2_emulation.so
06-01 13:17:28.578  25469-25521/br.com.escolaemmovimento D/﹕ HostConnection::get() New Host Connection established 0xaf60b940, tid 25521
06-01 13:17:28.604  25469-25521/br.com.escolaemmovimento I/OpenGLRenderer﹕ Initialized EGL, version 1.4
06-01 13:17:28.635  25469-25521/br.com.escolaemmovimento D/OpenGLRenderer﹕ Enabling debug mode 0
06-01 13:17:28.650  25469-25521/br.com.escolaemmovimento W/EGL_emulation﹕ eglSurfaceAttrib not implemented
06-01 13:17:28.651  25469-25521/br.com.escolaemmovimento W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xaf639400, error=EGL_SUCCESS
06-01 13:17:54.808  25469-25469/br.com.escolaemmovimento I/System.out﹕ com.android.volley.NoConnectionError: java.net.UnknownHostException: Unable to resolve host "teste.escolaemmovimento.com.br": No address associated with hostname 

Anyone has already faced this issue? This is a problem only associate with the emulator? Thanks for any help.

有人已经遇到过这个问题吗?这是一个只与模拟器关联的问题?谢谢你的帮助。

1 个解决方案

#1


0  

UnknownHostException is thrown to indicate that the IP address of a host could not be determined. Make sure you have internet access inside of Genymotion.

抛出UnknownHostException以指示无法确定主机的IP地址。确保您在Genymotion内部有互联网接入。

#1


0  

UnknownHostException is thrown to indicate that the IP address of a host could not be determined. Make sure you have internet access inside of Genymotion.

抛出UnknownHostException以指示无法确定主机的IP地址。确保您在Genymotion内部有互联网接入。