1.原因:由于2018年发布的Android P限制了非加密的流量请求导致出现 not permitted by network security policy

2.解决方法:

(1)把所有的http请求全部改为https请求

(2)

①在res的xml目录(),然后创建一个名为:network_config.xml文件

②在文件中设置cleartextTrafficPermitted为开启状态,network_config.xml文件代码如下:

<?xml version="1.0" encoding="utf-8"?>
<network-security-config><base-config cleartextTrafficPermitted="true" />
</network-security-config>

③并在AndroidManifest.xml中配置cleartextTrafficPermitted

android:networkSecurityConfig="@xml/network_config"

安卓9.0系统出现 CLEARTEXT communication to XX not permitted by network security policy相关推荐

  1. 网络请求未知错误 CLEARTEXT communication to XX not permitted by network security policy 解决方案

    这里简单的用了聚合免费的接口写了一个demo,专门来解决这个bug 搭建完MVP框架后,设置baseUrl开始请求.找了好久感觉没问题,后来查了资料才知道,是我们的baseUrl的问题 因为是内部测试 ...

  2. CLEARTEXT communication to xxx not permitted by network security policy

    2019独角兽企业重金招聘Python工程师标准>>> Android P http网络请求不通,报出异常:java.net.UnknownServiceException: CLE ...

  3. Android 9.0以上联网报错:CLEARTEXT communication to xxx.xxx.xxx.xx not permitted by network security policy

    Google为了保证用户数据和设备安全,针对Android 系统(Android P) 的应用程序,将要求默认使用加密连接.Android P 将禁止 App 使用所有未加密的连接,因此运行 Andr ...

  4. 关于网络请求报错:CLEARTEXT communication to xx.xx.xx.xx not permitted by network security policy

    问题 高版本Android项目运行报错:CLEARTEXT communication to xx.xx.xx.xx not permitted by network security policy ...

  5. CLEARTEXT communication to “ “ not permitted by network security policy处理办法

    ok http3 + retrofit 网络请求,在Android9.0手机上请求失败,报错:CLEARTEXT communication to " " not permitte ...

  6. 网络请求失败CLEARTEXT communication to “ “ not permitted by network security policy

    ok http3 + retrofit 网络请求,在Android9.0手机上请求失败,报错:CLEARTEXT communication to " " not permitte ...

  7. error:CLEARTEXT communication to api.help.bj.cn not permitted by network security policy

    这个问题出现的原因是Android P系统限制了明文流量的网络请求 处理方法就是 1 首先需要在res 目录下创建一个xml 包然后在创建一个xml  如下图 里面的内容 <?xml versi ...

  8. android 9.0 https 适配,android9.0适配HTTPS:not permitted by network security policy'

    express框架 一.express的使用 安装express 在根目录下输入 npm install express 引入express的包 const express = require(&qu ...

  9. java.net.UnknownServiceException: CLEARTEXT communication ** not permitted by network security polic

    转载仅供本人存档及后续研究使用,请尊重原创. 转载自:https://blog.csdn.net/yonbor605/article/details/82223882 Android P http网络 ...

最新文章

  1. 无损卡尔曼滤波UKF与多传感器融合
  2. 基于Grafana的监控数据钻取功能应用实践
  3. linux shell ln命令 建立文件符号链接
  4. [ZJOI2007]仓库建设(斜率优化)
  5. python哈夫曼树_python霍夫曼树
  6. 基础提供程序在 Open 上失败
  7. 知名Node.js组件存在代码注入漏洞
  8. 【EPS精品教程】基于DOM和DSM创建垂直模型、加载垂直模型
  9. 设有两个16位整数变量A和B,试编写完成下述操作的程序。
  10. Ubuntu下常用命令总结
  11. 100路监控需要使用核心交换机吗?
  12. C语言结构体(struct)类型的各种用法
  13. 在线修改域控的IP和机器名
  14. _id随机的 es_es 的数据操作
  15. 征集 | AAAI 2021线下论文预讲会讲者征集
  16. 《Python语言程序设计基础》嵩天著-第4章程序部分练习题答案
  17. 地震应急综合解决方案
  18. golang调用aliyun的语音通话
  19. 2022年4月份京东有什么活动?
  20. ECS服务器10M带宽能让多少人同时访问?

热门文章

  1. mac 时间机器 禁用_如何在Mac上禁用屏幕时间通知
  2. 将SQL server2019数据库部署在虚拟机上
  3. 计算机绩点3.2算什么水平,绩点3.3代表什么水平
  4. Pandas中replace替换问题
  5. 十万条评论告诉你《流浪地球》的1星都是谁打的?
  6. H3C单臂路由的配置
  7. 地表温度lst数据的下载【国家青藏高原科学数据中心】
  8. matlab ezplot fplot,[求助]fplot和ezplot功能一样啊?
  9. 【记vue项目中的踩坑日记】一杯茶一包烟,一个bug搞一天
  10. MindSpore论坛十一月活动宣传