安卓9.0系统出现 CLEARTEXT communication to XX not permitted by network security policy
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相关推荐
- 网络请求未知错误 CLEARTEXT communication to XX not permitted by network security policy 解决方案
这里简单的用了聚合免费的接口写了一个demo,专门来解决这个bug 搭建完MVP框架后,设置baseUrl开始请求.找了好久感觉没问题,后来查了资料才知道,是我们的baseUrl的问题 因为是内部测试 ...
- CLEARTEXT communication to xxx not permitted by network security policy
2019独角兽企业重金招聘Python工程师标准>>> Android P http网络请求不通,报出异常:java.net.UnknownServiceException: CLE ...
- Android 9.0以上联网报错:CLEARTEXT communication to xxx.xxx.xxx.xx not permitted by network security policy
Google为了保证用户数据和设备安全,针对Android 系统(Android P) 的应用程序,将要求默认使用加密连接.Android P 将禁止 App 使用所有未加密的连接,因此运行 Andr ...
- 关于网络请求报错: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 ...
- CLEARTEXT communication to “ “ not permitted by network security policy处理办法
ok http3 + retrofit 网络请求,在Android9.0手机上请求失败,报错:CLEARTEXT communication to " " not permitte ...
- 网络请求失败CLEARTEXT communication to “ “ not permitted by network security policy
ok http3 + retrofit 网络请求,在Android9.0手机上请求失败,报错:CLEARTEXT communication to " " not permitte ...
- error:CLEARTEXT communication to api.help.bj.cn not permitted by network security policy
这个问题出现的原因是Android P系统限制了明文流量的网络请求 处理方法就是 1 首先需要在res 目录下创建一个xml 包然后在创建一个xml 如下图 里面的内容 <?xml versi ...
- android 9.0 https 适配,android9.0适配HTTPS:not permitted by network security policy'
express框架 一.express的使用 安装express 在根目录下输入 npm install express 引入express的包 const express = require(&qu ...
- java.net.UnknownServiceException: CLEARTEXT communication ** not permitted by network security polic
转载仅供本人存档及后续研究使用,请尊重原创. 转载自:https://blog.csdn.net/yonbor605/article/details/82223882 Android P http网络 ...
最新文章
- 无损卡尔曼滤波UKF与多传感器融合
- 基于Grafana的监控数据钻取功能应用实践
- linux shell ln命令 建立文件符号链接
- [ZJOI2007]仓库建设(斜率优化)
- python哈夫曼树_python霍夫曼树
- 基础提供程序在 Open 上失败
- 知名Node.js组件存在代码注入漏洞
- 【EPS精品教程】基于DOM和DSM创建垂直模型、加载垂直模型
- 设有两个16位整数变量A和B,试编写完成下述操作的程序。
- Ubuntu下常用命令总结
- 100路监控需要使用核心交换机吗?
- C语言结构体(struct)类型的各种用法
- 在线修改域控的IP和机器名
- _id随机的 es_es 的数据操作
- 征集 | AAAI 2021线下论文预讲会讲者征集
- 《Python语言程序设计基础》嵩天著-第4章程序部分练习题答案
- 地震应急综合解决方案
- golang调用aliyun的语音通话
- 2022年4月份京东有什么活动?
- ECS服务器10M带宽能让多少人同时访问?