I'm using version 2.0.0 of RxJava, and it seems like I have no access to AndroidSchedulers
. I'm unable to get access to mainthread through RxJava
AndroidSchedulers
class is a part of RxAndroid
library. Add it to your app's build.gradle
:
before Gradle v3.0:
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
since Gradle v3.0:
implementation 'io.reactivex.rxjava2:rxandroid:2.0.1'
Go back to Old Versions:
compile 'io.reactivex:rxandroid:1.2.1'
compile 'io.reactivex:rxjava:1.1.6'
Then to the Newer Version:
compile 'io.reactivex.rxjava2:rxandroid:2.0.1'
compile 'io.reactivex.rxjava2:rxjava:2.1.1'
Sounds Weird but it works
I had same problem. You cannot call AndroidSchedulers with RxJava3. I think this is a bug. They need to fix it.
You need to add they on your dependencies of gradle:
//RxAndroid
implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'
//RxJava
implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With