After updating Android Room from 2.2.6 to 2.3.0 it stopped processing @androidx.annotation.NonNull
annotations, they are ignored now.
When installing the app after upgrade, I get:
Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number. You can simply fix this by increasing the version number.
Example code that used to work in Room 2.2.6:
@NonNull
@ColumnInfo(name = "span_type")
var spanType: SpanType? = null
after upgrading to 2.3.0 generates changes in schema (I have both exportSchema
and room.schemaLocation
set):
In the example above SpanType
is enum
, but I also have these annotations on other fields, e.g. @NonNull var objectId: Long? = null
and they also get ignored after upgrade.
I know I can use workarounds but this is not what I want to do - I searched through docs, release notes, etc. and couldn't find any info that @NonNull
support is deprecated or removed. I also tested with previous kotlin version (1.4.x instead of 1.5.20) and there's no difference.
The closest SO question is probably this one, but accepted answer is obviously wrong - kotlin supports @NonNull
annotations.
Do you have any ideas what I am missing?