I want to implement autoMigrations with Android Room
@Database(
entities = [User1Message::class],
version = 2,
autoMigrations = [AutoMigration (from = 1, to = 2)],
)
abstract class User1MessageDatabase : RoomDatabase() {
I also add this code in gradle
kapt {
arguments {
arg("room.schemaLocation", "$projectDir/schemas")
}
}
But error message says that not found.

1.json is in folder already

How to solve it?
UPDATE:
User1MessageDatabase has only 2.json
how to auto generate 1.json?

how to auto generate 1.json?
Revert the code to version 1, then add the exportSchema = true and then compile the project. Move to version 2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With