Room Persistence Library run time exception when calling Rooms inMemoryBuilder method

前端 未结 8 930
不思量自难忘°
不思量自难忘° 2020-12-09 16:13

When following the tutorial for setting up the Room persistence library I run in to this error when testing on an Android device.

java.lang.RuntimeException: cannot

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-09 16:39

    You must add the annotation processor dependency to the module where your AppDatabase is. I assumed that the app would take the depencency from my API library module, where my data model classes are, but apparently this is not the case.

    Answer came from this google issue: https://issuetracker.google.com/issues/67520422 And this SO answer: https://stackoverflow.com/a/43918701/1959110

提交回复
热议问题