java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Platform

09-20 11:16:43.121 11934-11934/? E/Zygote: MountEmulatedStorage()

    v2

09-20 11:16:43.121 11934-11934/? E/Zygote: accessInfo : 0

09-20 11:16:43.121 11934-11934/? E/SELinux: [DEBUG] get_category: variable seinfo: default sensitivity: NULL, cateogry: NULL

09-20 11:16:46.621 11934-12167/com.hotbitmapgg.ohmybilibili E/AndroidRuntime: FATAL EXCEPTION: RxIoScheduler-2

    Process: com.hotbitmapgg.ohmybilibili, PID: 11934

    java.lang.IllegalStateException: Fatal Exception thrown on Scheduler.Worker thread.

        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:62)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422)

        at java.util.concurrent.FutureTask.run(FutureTask.java:237)

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152)

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265)

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)

        at java.lang.Thread.run(Thread.java:818)

    Caused by: java.lang.NoClassDefFoundError: Failed resolution of: Lokhttp3/internal/Platform;

        at okhttp3.logging.HttpLoggingInterceptor$Logger$1.log(HttpLoggingInterceptor.java:109)

        at okhttp3.logging.HttpLoggingInterceptor.intercept(HttpLoggingInterceptor.java:157)

        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)

        at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)

        at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)

        at okhttp3.RealCall.execute(RealCall.java:77)

        at retrofit2.OkHttpCall.execute(OkHttpCall.java:180)

        at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$RequestArbiter.request(RxJavaCallAdapterFactory.java:171)

        at rx.internal.operators.OperatorSubscribeOn$1$1$1.request(OperatorSubscribeOn.java:80)

        at rx.Subscriber.setProducer(Subscriber.java:211)

        at rx.internal.operators.OperatorSubscribeOn$1$1.setProducer(OperatorSubscribeOn.java:76)

        at rx.internal.operators.OperatorMap$MapSubscriber.setProducer(OperatorMap.java:99)

        at rx.Subscriber.setProducer(Subscriber.java:205)

        at rx.Subscriber.setProducer(Subscriber.java:205)

        at rx.Subscriber.setProducer(Subscriber.java:205)

        at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:152)

        at retrofit2.adapter.rxjava.RxJavaCallAdapterFactory$CallOnSubscribe.call(RxJavaCallAdapterFactory.java:138)

        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50)

        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)

        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50)

        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)

        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:50)

        at rx.internal.operators.OnSubscribeLift.call(OnSubscribeLift.java:30)

        at rx.Observable.unsafeSubscribe(Observable.java:8460)

        at rx.internal.operators.OperatorSubscribeOn$1.call(OperatorSubscribeOn.java:94)

        at rx.internal.schedulers.CachedThreadScheduler$EventLoopWorker$1.call(CachedThreadScheduler.java:222)

        at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)

        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:422) 

        at java.util.concurrent.FutureTask.run(FutureTask.java:237) 

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:152) 

        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:265) 

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) 

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) 

        at java.lang.Thread.run(Thread.java:818) 

    Caused by: java.lang.ClassNotFoundException: Didn't find class "okhttp3.internal.Platform" on path: DexPathList[[zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/base.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_dependencies_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_0_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_1_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_2_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_3_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_4_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_5_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_6_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_7_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_8_apk.apk", zip file "/data/app/com.hotbitmapgg.ohmybilibili-2/split_lib_slice_9_apk.apk"],nativeLibraryDi

09-20 11:16:46.641 11934-11934/com.hotbitmapgg.ohmybilibili E/RecyclerView: No adapter attached; skipping layout

    No adapter attached; skipping layout

09-20 11:16:46.701 11934-11934/com.hotbitmapgg.ohmybilibili E/RecyclerView: No adapter attached; skipping layout



解决问题:

使用OKHttp3作为网络访问的框架时,可能要经常查看日志,这时我们可以引入logging-interceptor拦截器。如下:

compile'com.squareup.okhttp3:logging-interceptor:3.8.1'

1

但是,如果出现如题目中的错误,那原因应该就是logging-interceptor的版本和OkHttp3的版本不一样,保持一样就可以了。

compile'com.squareup.okhttp3:logging-interceptor:3.8.1'compile'com.squareup.okhttp3:okhttp:3.8.1'

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home...
    光剑书架上的书阅读 9,513评论 2 8
  • 这个原因是无法链接.so文件, 1、在配置文件的defaultConfig中添加: ndk{ //选择要添加的对应...
    lijingbo阅读 12,126评论 0 0
  • 用两张图告诉你,为什么你的 App 会卡顿? - Android - 掘金 Cover 有什么料? 从这篇文章中你...
    hw1212阅读 14,573评论 2 59
  • http://www.jianshu.com/p/f343782f19fc 背景 10月2号凌晨12:08收到报警...
    吃番茄的土拨鼠阅读 5,566评论 2 4
  • 我想开始的时候给她一个约定 之后我便爱的深沉 愿她感到欢欣 在十日后的分别 我递她一张志摩的诗 一面是二首“沙扬娜...
    四代木阅读 1,414评论 0 0

友情链接更多精彩内容