Android 异常: failed to connect to localhost/127.0.0.1

Posted MojoJojo

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Android 异常: failed to connect to localhost/127.0.0.1相关的知识,希望对你有一定的参考价值。

连接本地web服务器,在模拟器不能连接到127.0.0.1。

android把127.0.0.1当作模拟器本机,而把计算机本地IP设为10.0.2.2,需要把需连接本地计算机web服务地址改为:http://10.0.2.2

以上是关于Android 异常: failed to connect to localhost/127.0.0.1的主要内容,如果未能解决你的问题,请参考以下文章

Android异常篇 Installation failed due to: ‘INSTALL_FAILED_TEST_ONLY‘

Android异常篇 Failed to initialize editor

Android异常篇 Failed to initialize editor

Android异常篇 Error: Execution failed for task ‘:app:clean‘. Unable to delete file

Error:Failed to resolve: com.android.support:support-annotations:26.0.2

failed to load resource怎么解决?