问题
I want to use One to One relationship in room that available from version 2.2.0-alpha1. My current room version 2.2.5 and I get an error:
error: Fields annotated with @Relation must be a List or Set.
回答1:
There is change in android name since androidx.
Make sure to use androidx instead of arch(deprecated) in app
def room_version = "2.2.5"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"
来源:https://stackoverflow.com/questions/62482475/android-room-error-fields-annotated-with-relation-must-be-a-list-or-set