Android Studio Failed to connect to /127.0.0.1:8080

定义了一个链接,http://localhost:8080/user_login.php,在模拟器中运行连接php的操作,
发现google不支持http传输,需要在配置文件里面加入
android:usesCleartextTraffic="true"
又爆出无法连接到127.0.0.1:8080,需要将127.0.0.1改成10.0.2.2即可
String connectURL="http://10.0.2.2:8080/user_login.php";
发布了27 篇原创文章 · 获赞 7 · 访问量 5万+

猜你喜欢

转载自blog.csdn.net/xiaoxiang22/article/details/100587513