1. 오류상세
- java.lang.IllegalStateException: 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.
2. 사용 Libaray 및 기능
- Room
3. 발생이유
- 생성했던 database안에 테이블 및 컬럼들이 변경 되었는데 소스상에서 변경된 상황을 App에게 알려주지 않았기 때문이다.
- 발생이유 상세예제
아래 *1차버전 소스에서 보면 history table을 하나만 관리하다가
*2차버전 소스에서 review table 을 하나 추가 했는데 이때 version을 증가시키지 않았기 때문에 오류가 발생한다.
9. 해결방법 - 1
- database version을 올려주고, Migration( ) 작업을 해준다.
- script (AppDatabase.kt)
'[Ad&Kotlin]-Kotlin문법 > 99. 오류 모읍집' 카테고리의 다른 글
E/RecyclerView: No adapter attached; skipping layout (2) | 2022.01.08 |
---|---|
No type arguments expected for class Call (0) | 2022.01.04 |
NoConnectionError. ClearTextHTTP traffic (0) | 2021.12.30 |