首页 > 代码库 > libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)

libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)

log报错如下:

Caused by: libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)
Caused by: libcore.io.ErrnoException: getaddrinfo failed: EACCES (Permission denied)

原因及解决方法:

主要是没有在AndroidManifest里面添加网络访问权限。

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

 

libcore.io.GaiException: getaddrinfo failed: EAI_NODATA (No address associated with hostname)