FallbackTodestructivemigration aus nicht genannt, weil "eine Migration von 8 bis 10 erforderlich war, aber nicht gefundeAndroid

Forum für diejenigen, die für Android programmieren
Anonymous
 FallbackTodestructivemigration aus nicht genannt, weil "eine Migration von 8 bis 10 erforderlich war, aber nicht gefunde

Post by Anonymous »

Ich habe mehrere Abstürze aus Crashlytics: < /p>
java.lang.IllegalStateException - A migration from 8 to 10 was required but not found.
Please provide the necessary Migration path via RoomDatabase.Builder.addMigration(Migration ...)
< /code>
Ich verwende die FallbackTodestructivemigration von auf diese Weise: < /p>
fun buildDatabase(context: Context): OneDatabase {
// Since Room is only used for FTS, destructive migration is enough because the tables
// are cleared every time the app launches.
// https://medium.com/androiddevelopers/un ... 1e04b07929
return Room.databaseBuilder(context, OneDatabase::class.java, databaseName)
.fallbackToDestructiveMigrationFrom(1, 2, 3, 4, 5, 6, 7, 8)
.fallbackToDestructiveMigrationOnDowngrade()
.addMigrations(*allMigrations())
.build()
}
< /code>
Und der Allmigrations -Spaß ist: < /p>
fun allMigrations() = arrayOf(
MIGRATION_9_10, MIGRATION_10_11, MIGRATION_11_12
)
< /code>
reicht dies nicht aus, um FallbackTodestructivemigration aus (...) auszulösen, wenn eine Migration von 8 bis 10 erforderlich ist? Ich bin verloren.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post