默认情况下,Android Pie会请求应用程序使用HTTPS连接而不是HTTP。因此无法在HTTP中访问restful API
https://android-developers.googleblog.com/2018/04/protecting-users-with-tls-by-default-in.html?m=1解释了如何选择退出特定域或任意域
<network-security-config> <domain-config cleartextTrafficPermitted="true"> <domain includeSubdomains="true">insecure.example.com</domain> <domain includeSubdomains="true">insecure.cdn.example.com</domain> </domain-config> </network-security-config>
我不确定Android Pie中引入的限制和此处提到的选择退出适用于使用dart:io
进行的HTTP连接。