# android.database.sqlite.SQLiteException: no such table: users (code 1 SQLITE_ERROR): , while compiling: SELECT * FROM users

- **ID:** `android/room-cursor-not-found`
- **Domain:** android
- **Category:** data_error
- **Error Code:** `1`
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

Room database migration failed or the schema version is mismatched, causing the table to not exist in the current database.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| Room 2.5.0 | active | — | — |
| Room 2.6.0 | active | — | — |

## Workarounds

1. **Add a proper migration to the Room database builder. Example: Room.databaseBuilder(context, AppDatabase.class, "my-db").addMigrations(MIGRATION_1_2).build(); where MIGRATION_1_2 is a Migration object that creates the table.** (85% success)
   ```
   Add a proper migration to the Room database builder. Example: Room.databaseBuilder(context, AppDatabase.class, "my-db").addMigrations(MIGRATION_1_2).build(); where MIGRATION_1_2 is a Migration object that creates the table.
   ```
2. **Use fallbackToDestructiveMigration() to recreate the database, but this will delete existing data. Only use in development or if data loss is acceptable.** (95% success)
   ```
   Use fallbackToDestructiveMigration() to recreate the database, but this will delete existing data. Only use in development or if data loss is acceptable.
   ```
3. **Export the schema and verify the JSON file matches the entities. Add @Database(entities = {User.class}, version = 2, exportSchema = true) and check the generated schema in app/schemas/.** (80% success)
   ```
   Export the schema and verify the JSON file matches the entities. Add @Database(entities = {User.class}, version = 2, exportSchema = true) and check the generated schema in app/schemas/.
   ```

## Dead Ends

- **** — This only works if the database version is reset; if the schema is still incorrect, the error persists. (60% fail)
- **** — Room manages schema versions; manual changes cause version conflicts and data loss. (85% fail)
- **** — Room will throw an IllegalStateException about missing migration or fallback to destructive migration if configured. (90% fail)
