簡體   English   中英

RxAndroid 的 BootstrapError

[英]BootstrapError for RxAndroid

我將使用 RxJava 和 RxAndroid。 我寫了一個簡單的 Observable。 (下面的代碼)

Observable<Task> taskObservable = Observable
                .fromIterable(DataSource.createTasksList())
                .subscribeOn(Schedulers.io())
                .observeOn(AndroidSchedulers.mainThread());

但我得到 BootstrapError! (以下錯誤)

java.lang.BootstrapMethodError: Exception from call site #1 bootstrap method

我有依賴項:

    implementation 'io.reactivex.rxjava3:rxandroid:3.0.0'
    implementation "io.reactivex.rxjava3:rxjava:3.0.2"

(我也為 rxjava 使用了 3.0.0)

將此包含在您的 Gradle 應用程序級文件中

 compileOptions {

       sourceCompatibility JavaVersion.VERSION_1_8
       targetCompatibility JavaVersion.VERSION_1_8

}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM