美文网首页
java.lang.NoClassDefFoundError:

java.lang.NoClassDefFoundError:

作者: 王冥 | 来源:发表于2018-09-20 11:40 被阅读80次

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'

相关文章

网友评论

      本文标题:java.lang.NoClassDefFoundError:

      本文链接:https://www.haomeiwen.com/subject/ypbgnftx.html