问题描述:
Android网络请求中报错
W/System.err: Caused by: java.net.ConnectException: failed to connect to /127.0.0.1 (port 8000) from /127.0.0.1 (port 60809) after 10000ms: isConnected failed: ECONNREFUSED (Connection refused)
原因分析:
安卓模拟器把 127.0.0.1/localhost 当做模拟器本身,没有访问电脑。
解决方案:
1.可以使用局域网ip代替