在过去的几周里,我在导入语句行中看到很多行号崩溃的情况。
例如,此堆栈跟踪在第2行发生崩溃
Fatal Exception: java.lang.IllegalArgumentException: Unexpected TLS version: NONE
at okhttp3.TlsVersion.forJavaName(TlsVersion.java:2)
at okhttp3.Handshake.get(Handshake.java:4)
at okhttp3.internal.connection.RealConnection.connectTls(RealConnection.java:12)
at okhttp3.internal.connection.RealConnection.establishProtocol(RealConnection.java:4)
at okhttp3.internal.connection.RealConnection.connect(RealConnection.java:13)
at okhttp3.internal.connection.StreamAllocation.findConnection(StreamAllocation.java:25)
at okhttp3.internal.connection.StreamAllocation.findHealthyConnection(StreamAllocation.java:1)
at okhttp3.internal.connection.StreamAllocation.newStream(StreamAllocation.java:5)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:5)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:10)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:1)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:22)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:10)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:1)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:22)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:10)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:5)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:10)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:1)
有人找到解决方案吗?
答案 0 :(得分:1)
我通过将这些规则添加到我的proguard配置中来修复了该问题
https://docs.fabric.io/android/crashlytics/dex-and-proguard.html
答案 1 :(得分:0)
使用版本3.10.0。
避免使用无效的HTTPS会话。这样可以防止OkHttp
因错误Unexpected TLS version: NONE
而崩溃。