Skip to content Skip to sidebar Skip to footer

Android Room Foreign Key Constraint Failed (code 787) When Insert New Row

I followed this post Android Room FOREIGN KEY constraint failed (code 787). Unfortunately, it not works in my case. I always get the error when trying to insert a new Note. Of cour

Solution 1:

I found the problem. Because I have been created 2 different Databases: TopicDataBase and NoteDataBase.

So I just need to remove 1 of them. My bad >"<

Solution 2:

(@PrimaryKey var id: Long? = null, looks like a problem. Primary key can't be null

Post a Comment for "Android Room Foreign Key Constraint Failed (code 787) When Insert New Row"