The versions i'm using are
implementation 'io.reactivex.rxjava2:rxjava:2.2.4'
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'com.jakewharton.rxbinding2:rxbinding:2.0.0'
implementation 'com.jakewharton.retrofit:retrofit2-rxjava2-adapter:1.0.0'
implementation 'android.arch.persistence.room:runtime:2.1.0-alpha04'
kapt 'android.arch.persistence.room:compiler:2.1.0-alpha04'
implementation 'android.arch.persistence.room:rxjava2:2.1.0-alpha04'
and the Dao is
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun insertStore(stores: Stores): Completable
From this great article on medium, i found that;
starting with Room 2.1.0-alpha01, DAO methods annotated with @Insert, @Delete or @Update support Rx return types Completable, Single and Maybe
Even though i was using the latest version of the room i was having the issue,
implementation 'android.arch.persistence.room:runtime:2.1.0-alpha04'
kapt 'android.arch.persistence.room:compiler:2.1.0-alpha04'
implementation 'android.arch.persistence.room:rxjava2:2.1.0-alpha04'
I found the issue was occuring because of using androidx in my project, so in order to fix that i had to use androidx room components.
implementation 'androidx.room:room-runtime:2.1.0-alpha04'
kapt 'androidx.room:room-compiler:2.1.0-alpha04'
implementation 'androidx.room:room-rxjava2:2.1.0-alpha04'
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