Skip to content Skip to sidebar Skip to footer

After Updating From Room 2.2.6 To 2.3.0 I Get An Error: "you Must Annotate Primary Keys With @nonnull."

I updated room from 2.2.6 to 2.3.0 and started seeing weird errors in the compiled/generated java code at compile time. I do not see any errors in my .kt files or in the generated

Solution 1:

Kotlin doesn't use @NonNull annotations - that's determined by your type itself, which in your case is a nullable Int?.

You'll need to change it to an Int and assign it a default value (i.e., -1).

Post a Comment for "After Updating From Room 2.2.6 To 2.3.0 I Get An Error: "you Must Annotate Primary Keys With @nonnull.""