zhou-you / RxEasyHttp

本库是一款基于RxJava2+Retrofit2实现简单易用的网络请求框架,结合android平台特性的网络封装库,采用api链式调用一点到底,集成cookie管理,多种缓存模式,极简https配置,上传下载进度显示,请求错误自动重试,请求携带token、时间戳、签名sign动态配置,自动登录成功后请求重发功能,3种层次的参数设置默认全局局部,默认标准ApiResult同时可以支持自定义的数据结构,已经能满足现在的大部分网络请求。
Apache License 2.0
3.13k stars 615 forks source link

下载apk会崩溃 #125

Closed 1843163412 closed 5 years ago

1843163412 commented 5 years ago

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String okhttp3.MediaType.toString()' on a null object reference

zhou-you commented 5 years ago

请贴出详细的错误日志

1843163412 commented 5 years ago

01-09 09:32:19.828 11494-11494/? E/RxEasyHttp:BaseSubscriber.onStart(L:48): -->http is onStart 01-09 09:32:19.851 11494-11501/? I/zygote64: Do partial code cache collection, code=61KB, data=38KB After code cache collection, code=61KB, data=38KB Increasing code cache capacity to 256KB 01-09 09:32:19.890 11494-11575/? D/RxEasyHttp:DownloadSubscriber.onNext(L:87): DownSubscriber:>>>> onNext 01-09 09:32:19.890 32218-32256/? I/Market-DataParser: [InvalidPackageList] JSON : invalidSystemPackageList list is null 01-09 09:32:19.891 11494-11575/? W/System.err: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String okhttp3.MediaType.toString()' on a null object reference 01-09 09:32:19.892 11494-11575/? W/System.err: at com.zhouyou.http.subsciber.DownloadSubscriber.writeResponseBodyToDisk(DownloadSubscriber.java:93) at com.zhouyou.http.subsciber.DownloadSubscriber.onNext(DownloadSubscriber.java:88) at com.zhouyou.http.subsciber.DownloadSubscriber.onNext(DownloadSubscriber.java:43) 01-09 09:32:19.893 11494-11575/? W/System.err: at io.reactivex.internal.util.HalfSerializer.onNext(HalfSerializer.java:108) at io.reactivex.internal.operators.observable.ObservableRetryWhen$RepeatWhenObserver.onNext(ObservableRetryWhen.java:100) at io.reactivex.internal.operators.observable.ObservableOnErrorNext$OnErrorNextObserver.onNext(ObservableOnErrorNext.java:68) at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.drainNormal(ObservableObserveOn.java:200) at io.reactivex.internal.operators.observable.ObservableObserveOn$ObserveOnObserver.run(ObservableObserveOn.java:252) 01-09 09:32:19.894 11494-11575/? W/System.err: at io.reactivex.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:66) at io.reactivex.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:57) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) 01-09 09:32:19.895 11494-11575/? W/System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764) 01-09 09:32:19.898 3431-3467/? I/octvm_klo: klo lock

zhou-you commented 5 years ago

已去掉引起错误的日志打印,请用V2.1.4版本,但是你也要确认下MediaType为什么没有类型