IllegalStateException: A migration from 1 to 2 was required but not found Android Origin: On your device OSI layer 7 · Application Last updated 25 Nov 2026

java.lang.IllegalStateException: A migration from 1 to 2 was required but not found. Please provide the necessary Migration path

The Room schema version increased but no migration describes how to upgrade existing data.

Exact message you may see A migration from 1 to 2 was required but not foundRoom migration required but not foundPlease provide the necessary Migration pathjava.lang.IllegalStateException: A migration from 1 to 2 was required but not found. Please provide the necessary Migration path via RoomDatabase.Builder.addMigration(Migration ...)
Seen on: Android Kotlin

Meaning

Provide a Migration(1, 2) (or use auto-migrations) or use fallbackToDestructiveMigration() during development. Always bump the version and export schemas.

Common causes

  • Version bumped without a Migration
  • Migration list not added to builder
  • Wrong version pair

⚡ Quick fix

  1. Add Migration(1,2) with ALTER TABLE
  2. Use @AutoMigration
  3. Dev only: fallbackToDestructiveMigration

Detailed fix by platform

Kotlin

  1. val M12 = object : Migration(1, 2) { override fun migrate(db: SupportSQLiteDatabase) { db.execSQL("ALTER TABLE user ADD COLUMN age INTEGER NOT NULL DEFAULT 0") } }

How to diagnose

  1. Versions — from/to?
  2. Builder — addMigrations?
  3. Schema — exported?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

App crashes after restore on a new phone — (behavior) crash on first launch after device transfer / Auto Backup (Android)App crashes after res…Cannot access database on the main thread — Room: Cannot access database on the main thread since it may potentially lock the UI for a long period of time (Android)Cannot access databas…Class android.support.v4 not found after AndroidX — java.lang.NoClassDefFoundError: android/support/v4/app/Fragment (Android)Class android.support…Core Data: Failed to load model named / Unresolved error — Fatal error: Unresolved error Error Domain=NSCocoaErrorDomain Code=134060 (iOS)Core Data: Failed to …CorruptionException: Unable to parse preferences proto — androidx.datastore.core.CorruptionException: Unable to parse preferences proto (Android)CorruptionException: …CursorWindow: Window is full: requested allocation bytes — android.database.CursorWindowAllocationException: Cursor window allocation of 2048 kb failed (Android)CursorWindow: Window …IllegalStateException: Cannot perform this operation because the connection pool has been closed — java.lang.IllegalStateException: attempt to re-open an already-closed object: SQLiteDatabase (Android)IllegalStateException…Room cannot verify the data integrity — Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number (Android)Room cannot verify th…IllegalSt…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.