When you are use Room Database with Android Jetpack Compose in that preview time this error come so we can create schemas folder in app module it will fix.
agp = "8.9.1"
kotlin = "2.1.20"
#Room
room = "2.7.0-rc03"
sqlite = "2.5.0-rc03"
#Room
room-runtime = { module = "androidx.room:room-runtime", version.ref = "room" }
room-compiler = { module = "androidx.room:room-compiler", version.ref = "room" }
sqlite-bundled = { module = "androidx.sqlite:sqlite-bundled", version.ref = "sqlite" }
//Room
implementation(libs.room.runtime)
implementation(libs.sqlite.bundled)
ksp(libs.room.compiler)
room {
schemaDirectory("$projectDir/schemas")
}
schemas