Skip to content

章节9.2.2 使用OkHttp 勘误 #43

Description

@JasperZhan

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

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

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

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions