Mopinion-com / mopinion-sdk-android

Mopinion Mobile SDK for Android. Built in native Kotlin
5 stars 0 forks source link

App is crashing because of Room cannot verify the data integrity after updating library. #6

Open antanas-radzevicius-tg opened 4 days ago

antanas-radzevicius-tg commented 4 days ago

hey, when trying to update SDK from "1.0.28" to "2.0.1", app is crashing on SDK init. IT ONLY HAPPENS WHEN UPDATING THE APP, NOT DOING FRESH INSTALL.

Suggestion add flag to Room setup where DeploymentDao is - .fallbackToDestructiveMigration(false)

Stack trace:

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. Expected identity hash: bb7bd98e96cb813133ca9aaaa55acba2, found: 1908721fbb8f68e59a2e14ed4584d98f
                                                                                                        at androidx.room.RoomOpenHelper.checkIdentity(RoomOpenHelper.kt:146)
                                                                                                        at androidx.room.RoomOpenHelper.onOpen(RoomOpenHelper.kt:127)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.onOpen(FrameworkSQLiteOpenHelper.kt:287)
                                                                                                        at android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:533)
                                                                                                        at android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:419)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getWritableOrReadableDatabase(FrameworkSQLiteOpenHelper.kt:232)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.innerGetDatabase(FrameworkSQLiteOpenHelper.kt:190)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper$OpenHelper.getSupportDatabase(FrameworkSQLiteOpenHelper.kt:151)
                                                                                                        at androidx.sqlite.db.framework.FrameworkSQLiteOpenHelper.getWritableDatabase(FrameworkSQLiteOpenHelper.kt:104)
                                                                                                        at androidx.room.RoomDatabase.inTransaction(RoomDatabase.kt:632)
                                                                                                        at androidx.room.RoomDatabase.assertNotSuspendingTransaction(RoomDatabase.kt:451)
                                                                                                        at androidx.room.RoomDatabase.query(RoomDatabase.kt:480)
                                                                                                        at androidx.room.util.DBUtil.query(DBUtil.kt:75)
                                                                                                        at com.mopinion.data.localdb.DeploymentDao_Impl$19.call(DeploymentDao_Impl.java:686)
                                                                                                        at com.mopinion.data.localdb.DeploymentDao_Impl$19.call(DeploymentDao_Impl.java:682)
                                                                                                        at androidx.room.CoroutinesRoom$Companion$execute$4$job$1.invokeSuspend(CoroutinesRoom.kt:87)
                                                                                                        at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
                                                                                                        at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)
                                                                                                        Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@6af396, Dispatchers.Default]