Hi there, I had a android and iOS app, in which i ...
# multiplatform
p
Hi there, I had a android and iOS app, in which i just introduced a Kotlin shared module (kmm), inside this module i am using "com.squareup.sqldelight" for local db now when i install this new app on the older version it crashes with some error of room db (which is implemented in android app) error log -
Copy code
java.lang.RuntimeException: Exception while computing database live data.
   androidx.room.RoomTrackingLiveData$1.run(RoomTrackingLiveData.java:92)
   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
   java.lang.Thread.run(Thread.java:1012)
Caused by:
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.
   androidx.room.RoomOpenHelper.checkIdentity(RoomOpenHelper.java:154)
   androidx.room.RoomOpenHelper.onOpen(RoomOpenHelper.java:135)
   androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onOpen(FrameworkSQLiteOpenHelper.java:201)
   android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:427)
   android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:316)
   androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableSupportDatabase(FrameworkSQLiteOpenHelper.java:151)
   androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.java:112)
   androidx.room.RoomDatabase.inTransaction(RoomDatabase.java:706)
   androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.java:483)
   androidx.room.RoomDatabase.query(RoomDatabase.java:526)
   androidx.room.util.DBUtil.query(DBUtil.java:86)
   com.musicmuni.riyaz.data.database.course.activecourse.ActiveCourseDao_Impl$8.call(ActiveCourseDao_Impl.java:353)
   com.musicmuni.riyaz.data.database.course.activecourse.ActiveCourseDao_Impl$8.call(ActiveCourseDao_Impl.java:350)
   androidx.room.RoomTrackingLiveData$1.run(RoomTrackingLiveData.java:90)
   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
   java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
   java.lang.Thread.run(Thread.java:1012)
k
Hi! Read this article https://raed-o-ghazal.medium.com/migrate-your-production-app-from-room-db-to-sqldelight-c99127bbdc8 you need to follow steps of migrating from Room to Sqldelight in order to make it works. even if you was using it on Android alone then migrating to KMM.