Android Room Error: Fields annotated with @Relation must be a List or Set

╄→гoц情女王★ 提交于 2021-02-11 14:17:29

问题


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

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