坑- observeOn(AndroidSchedulers.mainThread())

observeOn(AndroidSchedulers.mainThread())報錯java

observeon(rx.Schedulers) in Observable cannot be applied to (io.reactivex.Schedulers)

引入沒法識別react

import rx.android.schedulers.AndroidSchedulers;
//    implementation 'io.reactivex.rxjava2:rxjava:2.2.8'
//    implementation 'io.reactivex.rxjava2:rxandroid:2.1.1'

其實是RxAndroid最高支持到1.2.1android

https://mvnrepository.com/search?q=rxAndroidapp

解決方案:spa

implementation 'io.reactivex:rxandroid:1.2.1'
相關文章
相關標籤/搜索