rxJava 2.x Observable回调observeOn报错的问题
最近从rxJava 1.x转到新版rxJava 2.x时,在使用Observable回调observeOn(AndroidSchedulers.mainThread())
时,报了以下错误
java.lang.NoClassDefFoundError: io.reactivex.Flowable
只知道rxJava 2.x对代码进行了重构,加入了背压的概念,然后这边查阅了一下Observable的api。
observeOn(Scheduler scheduler)
Modifies an ObservableSource to perform its emissions and notifications on a specified Scheduler, asynchronously with an unbounded buffer with Flowable.bufferSize() “island size”.observeOn(Scheduler scheduler, boolean delayError)
Modifies an ObservableSource to perform its emissions and notifications on a specified Scheduler, asynchronously with an unbounded buffer with Flowable.bufferSize() “island size” and optionally delays onError notifications.