【问题标题】:Pie volley connection派凌空连接
【发布时间】:2019-05-21 20:03:34
【问题描述】:

Android volley 在 pie 中不起作用我已经使用了两种方法来解决这个 http 问题。

清单

android:networkSecurityConfig="@xml/network_security_config"

xml

<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
    <base-config cleartextTrafficPermitted="true">
        <trust-anchors>
            <certificates src="system" />
        </trust-anchors>
    </base-config>
</network-security-config>

还有

 android:usesCleartextTraffic="true"

【问题讨论】:

  • 添加堆栈跟踪。
  • 你的意思是try catch?
  • 添加你的 logcat 错误
  • E/Volley:[19988] NetworkDispatcher.run:未处理的异常 java.lang.RuntimeException:存根! java.lang.RuntimeException:存根!在 org.apache.http.ProtocolVersion.(ProtocolVersion.java:6) 在 com.android.volley.toolbox.HurlStack.performRequest(HurlStack.java:148) 在 com.android.volley.toolbox.BasicNetwork.performRequest (BasicNetwork.java:97) 在 com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:118)

标签: android android-volley


【解决方案1】:

试试这个:

xml

<network-security-config>
<base-config cleartextTrafficPermitted="true">
    <trust-anchors>
        <certificates src="system" />
        <certificates src="user" />
    </trust-anchors>
</base-config>

【讨论】:

    猜你喜欢
    • 2014-11-18
    • 2016-01-22
    • 2016-12-27
    • 1970-01-01
    • 2020-02-16
    • 2023-03-29
    • 1970-01-01
    • 1970-01-01
    • 2016-11-20
    相关资源
    最近更新 更多