greenrobot / greenDAO

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.
http://greenrobot.org/greendao/
12.63k stars 2.89k forks source link

disk image is malformed (Sqlite code 11 SQLITE_CORRUPT) #1100

Closed qidianli closed 1 year ago

qidianli commented 1 year ago

Please deal th question Question Description: The database version was upgraded from 4 to 6, a database table was added, and an error was reported after the APP covered the upgrade and installed

Caused by: android.database.sqlite.SQLiteDatabaseCorruptException:database disk image is malformed (Sqlite code 11 SQLITE_CORRUPT), (OS error - 11:Try again) android.database.sqlite.SQLiteConnection.nativeExecute(Native Method) android.database.sqlite.SQLiteConnection.execute(SQLiteConnection.java:692) android.database.sqlite.SQLiteSession.endTransactionUnchecked(SQLiteSession.java:449) android.database.sqlite.SQLiteSession.endTransaction(SQLiteSession.java:413) android.database.sqlite.SQLiteDatabase.endTransaction(SQLiteDatabase.java:611) android.database.sqlite.SQLiteOpenHelper.getDatabaseLocked(SQLiteOpenHelper.java:442) android.database.sqlite.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:332) com.project.common.sqlUtil.greendao.DbController.getWritableDatabase(DbController.java:90) com.project.common.sqlUtil.greendao.DbController.(DbController.java:66) com.project.common.sqlUtil.greendao.DbController.getInstance(DbController.java:50) com.project.common.sqlUtil.dao.InformationDao.queryAll(InformationDao.java:27) cn.com.qlwb.qiluyidian.Main.initInformationHis(Main.java:456) cn.com.qlwb.qiluyidian.Main.initMain(Main.java:422)

greenrobot-team commented 1 year ago

Thanks for reporting. However, this is nothing greenDAO specific, but rather an issue with SQLite. See e.g. https://stackoverflow.com/a/2960439/9187282.