Room Persistence Library: attempt to re-open an already-closed object

You have to provide Migration.In Live App you can't tell every person please delete app and reinstall app.

In Room New Version 1.0.0-alpha9 Room adds support for the NOT NULL constraint.

That is going to change the schema that Room generates. Because it changes the schema, it also changes the identityHash of the DB and that is used by Room to uniquely identify every DB version. Therefore, we need a migration

For Migration From 1.0.0-alpha5 to 1.0.0-alpha9 please visit below article. Very Good Article for Migrate from old version to 1.0.0-alpha9 version.

https://medium.com/@manuelvicnt/android-room-upgrading-alpha-versions-needs-a-migration-with-kotlin-or-nonnull-7a2d140f05b9


Had the same issue. Be aware that database may persist after uninstall.

In manifest you need to do

    android:allowBackup="false"