Android 11 系统上 Okhttp 3.10 版本上部分手机出现 Java .lang.VerifyError:Superclass okhttp3.internal.http1.Http1Codec$AbstractSource

2021-01-06 17:36:45 +08:00
 haydenjie
Caused by:
5 java.lang.VerifyError:Superclass okhttp3.internal.http1.Http1Codec$AbstractSource of okhttp3.internal.http1.Http1Codec$UnknownLengthSource is declared final (declaration of 'okhttp3.internal.http1.Http1Codec$UnknownLengthSource'

appears in /data/app/~~7Slsz0eTU_atlqLyl7NGKQ==/com.zhenhui.huilianyi-5gJPwjBAIcieNSC9WYPr4g==/base.apk)
6 okhttp3.internal.http1.Http1Codec.f(Http1Codec.java:259)
7 okhttp3.internal.http1.Http1Codec.a(Http1Codec.java:153)
8 okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:124)
9 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:147)
10 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:121)
11 com.huilianyi.hlybaselibrary.http.HttpClientManager$1.intercept(HttpClientManager.java:39)
12 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:147)
13 okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
14 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:147)
15 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:121)
16 okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
17 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:147)
18 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:121)
19 okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
20 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:147)
21 okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:126)
22 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:147)
23 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:121)
24 com.huilianyi.hlybaselibrary.http.intercept.HttpInterceptor.intercept(HttpInterceptor.java:63)
25 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:147)
26 okhttp3.internal.http.RealInterceptorChain.a(RealInterceptorChain.java:121)
27 okhttp3.RealCall.i(RealCall.java:200)
28 okhttp3.RealCall.b(RealCall.java:77)
29 retrofit2.OkHttpCall.execute(OkHttpCall.java:180)
30 retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171)
31 rx.internal.operators.OperatorSubscribeOn$1$1$1.request(OperatorSubscribeOn.java:80)
32 rx.Subscriber.setProducer(Subscriber.java:209)
33 rx.internal.operators.OperatorSubscribeOn$1$1.setProducer(OperatorSubscribeOn.java:76)
34 rx.Subscriber.setProducer(Subscriber.java:205)
35 retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)
36 retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)
37 rx.internal.operators.OnSubscribeLift.a(OnSubscribeLift.java:50)
38 rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)
39 rx.Observable.a(Observable.java:8666)
40 rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)
41 rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:220)
42 rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
43 java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)
44 java.util.concurrent.FutureTask.run(FutureTask.java:266)
45 java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
46 java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
47 java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
48 java.lang.Thread.run(Thread.java:923)
8901 次点击
所在节点    Android
2 条回复
chenjiajia9411
2021-01-07 09:21:34 +08:00
混淆有问题,AbstractSource 给弄成 final 了,把 allowaccessmodification 关了,以后上传的日志最好也带上符号表或者直接还原不然不方便看。
还有如果还需要兼容 API 21 以下就把 OkHttp 升级到 3.12.12 ,不需要兼容的话直接升级到 4.9.0 吧。
haydenjie
2021-01-08 16:14:07 +08:00
我看了一下这个 allowaccessmodification 这个配置工程里面没有,但是在 build 里面生成的配置文件里面找了这个,这个配置好像只会把 private 变成 public 。 现在是 bugly 上统计到部分 Android11 的手机出现,我找相同的手机却不能出现这个报错。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/742276

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX