I am using Room database android every thing work fine but @DatabaseView annotation can't be resolved (Giving Error) bellow are the dependencies
def room_version = "1.1.1"
implementation "android.arch.persistence.room:runtime:$room_version"
kapt "android.arch.persistence.room:compiler:$room_version"
Room version should be 2.1.0-alpha02 or greater
@DatabaseView
is added in the room version 2.1.0-alpha02
Please check the release notes for more detail https://developer.android.com/jetpack/docs/release-notes
Also, it is available only on androidx
So change it to
def room_version = "2.1.0-alpha02"
implementation "androidx.room:room-runtime:runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.