Android-Daily-Interview icon indicating copy to clipboard operation
Android-Daily-Interview copied to clipboard

2019-10-24:谈一谈Android P禁用http对我们开发有什么影响?

Open MoJieBlog opened this issue 6 years ago • 3 comments

大家1024快乐。

MoJieBlog avatar Oct 24 '19 01:10 MoJieBlog

遇到过一次,禁用的结果就是导致Http的请求无效了。

我们的现象就是,http的图片展示不出来了。

最直接的解决方案: 1,让后台换链接,也应该要换 2,target 设置在27及以下。

yline avatar Jan 30 '20 10:01 yline

  • APP改用https请求
  • targetSdkVersion 降到27以下
  • res --> add : network_security_config.xml
 <?xml version="1.0" encoding="utf-8"?>
 <network-security-config>
     <base-config cleartextTrafficPermitted="true" />
 </network-security-config>

AndroidManifest.xml--> application :
android:networkSecurityConfig="@xml/network_security_config"

thormys avatar May 12 '20 16:05 thormys

无法访问http的请求

mlinqirong avatar Jan 10 '22 08:01 mlinqirong