安卓9.0新的限制
對未加密流量不在信任,直接放棄請求
解決方案參考這個
https://blog.csdn.net/qq_18620851/article/details/80617549
https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted
就是額外設定請求的配置
最簡單的配置方法是在清單檔案中配置android:usesCleartextTraffic=“true”:
例子:
AndroidManifest.xml –
<?xml version="1.0" encoding="utf-8"?>
<manifest …>
<application
…
android:usesCleartextTraffic=“true”
…>
…