Android room insert with Completable not working? methods annotated with @insert can return either void,long?

醉酒当歌 提交于 2019-12-06 15:59:03

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'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!