[我正在xammp
上将php
服务器用于localhost
,我在更新之前就在工作(我认为),但是现在http连接给我一个例外:
W / System.err:java.io.IOException:的明文HTTP流量 不允许192.168.0.105
我曾尝试在android:usesCleartextTraffic="true"
的Application
上添加AndroidManifrst
,但还会出现下一个错误:
属性usesCleartextTraffic仅在API级别23和更高版本中使用(当前最小值为17)
我想保持对API 17
的支持,发布我的应用程序时,我将在公共服务器上使用https,现在该怎么办?
您不必将应用程序的minSdkVersion或targetSdkVersion设置为23(Android棉花糖)即可使用android:usesCleartextTraffic。在较旧的平台上,此属性被简单地忽略,因此无效。
参考-https://android-developers.googleblog.com/2016/04/protecting-against-unintentional.html?m=1