本文介绍了内部是否机器人使用okhttp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这是一个堆栈跟踪运行Android应用程序最近,我继承时,我得到。我们不使用okhttp为显式依赖,并在跟踪的com.android.okhttp使我想起了AOSP使用okhttp现在在内部?

  java.lang.Throwable中:显式的终止方法关闭不叫
                        Ë在dalvik.system.CloseGuard.open(CloseGuard.java:184)
                        Ë在com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:278)
                        Ë在com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
                        Ë在com.android.okhttp.Connection.connect(Connection.java:107)
                        Ë在com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
                        Ë在com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
                        Ë在com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
                        Ë在com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
                        Ë在com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
                        吃com.android.okhttp.internal.http.HttpURLConnectionImpl.getHeaderField(HttpURLConnectionImpl.java:143)
                        Ë在java.net.URLConnection.getHeaderFieldInt(URLConnection.java:544)
                        Ë在java.net.URLConnection.getContentLength(URLConnection.java:316)
                        吃com.android.okhttp.internal.http.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:18
                           2)
 

解决方案

是Android的为Android 4.4系统的,是用OkHttp其内部的HttpURLConnection 的实施。

This is a stack trace I get when running an android app I recently inherited. We're not using okhttp as an explicity dependency, and the com.android.okhttp in the trace makes me think the aosp is using okhttp now internally?

java.lang.Throwable: Explicit termination method 'close' not called
                        E      at dalvik.system.CloseGuard.open(CloseGuard.java:184)
                        E      at com.android.org.conscrypt.OpenSSLSocketImpl.startHandshake(OpenSSLSocketImpl.java:278)
                        E      at com.android.okhttp.Connection.upgradeToTls(Connection.java:146)
                        E      at com.android.okhttp.Connection.connect(Connection.java:107)
                        E      at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:294)
                        E      at com.android.okhttp.internal.http.HttpEngine.sendSocketRequest(HttpEngine.java:255)
                        E      at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:206)
                        E      at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:345)
                        E      at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:296)
                        E      at com.android.okhttp.internal.http.HttpURLConnectionImpl.getHeaderField(HttpURLConnectionImpl.java:143)
                        E      at java.net.URLConnection.getHeaderFieldInt(URLConnection.java:544)
                        E      at java.net.URLConnection.getContentLength(URLConnection.java:316)
                        E      at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getContentLength(HttpsURLConnectionImpl.java:18
                           2)
解决方案

Yes, Android as of Android 4.4 is using OkHttp for its internal HttpUrlConnection implementation.

这篇关于内部是否机器人使用okhttp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-21 18:39