Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

章节9.2.2 使用OkHttp 勘误 #43

Open
JasperZhan opened this issue Jun 3, 2021 · 0 comments
Open

章节9.2.2 使用OkHttp 勘误 #43

JasperZhan opened this issue Jun 3, 2021 · 0 comments

Comments

@JasperZhan
Copy link

示例代码运行会有错误,无法获取数据

报错:CLEARTEXT communication to www.baidu.com not permitted by network security policy

因为Android 9.0 限制了明文流量的网络请求,非加密的流量请求会被系统禁止掉

需要在application节点添加android:usesCleartextTraffic="true"或者http换成https

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant