erluxman
erluxman

Reputation: 19415

java.lang.NoClassDefFoundError: io.reactivex.Flowable

I am using RxJava Version 2.0.1. Using Android Studio 3.0 Canary 6.

I have some code like this

private void subscribeToObservable(Observable<List<CalendarDto>> observable) {
    DisposableObserver<List<CalendarDto>> d = getDisposableimportantDaysObserver();
    observable.subscribeOn(Schedulers.computation())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(d);
    disposables.add(d);
}

But the problem is My app crashes whenever I run this code in android device with API 19( Kitkat, have not checked lower than that) , but it runs fine in my android 7.0 emulator. The Error log

java.lang.NoClassDefFoundError: io.reactivex.Flowable at io.reactivex.Observable.bufferSize(Observable.java:126) at io.reactivex.Observable.observeOn(Observable.java:8412)

This is not because of my proguard as I deleted all the code in the proguard config file but the issue was still there.

Does anyone have Idea what might be going wrong ?

Upvotes: 1

Views: 2517

Answers (1)

IntelliJ Amiya
IntelliJ Amiya

Reputation: 75788

java.lang.NoClassDefFoundError: io.reactivex.Flowable at io.reactivex.Observable.bufferSize(Observable.java:126) at io.reactivex.Observable.observeOn(Observable.java:8412)

Don't

 .observeOn(AndroidSchedulers.mainThread())

Do

.observeOn(AndroidSchedulers.mainThread(),false,100) // Add SIZE

Upvotes: 3

Related Questions