sqlcipher / android-database-sqlcipher

Android SQLite API based on SQLCipher
https://www.zetetic.net/sqlcipher/sqlcipher-for-android/
Other
2.73k stars 564 forks source link

net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master #604

Closed Developmc closed 1 year ago

Developmc commented 1 year ago

My project has been using version 3.5.7,When I upgraded to 4.5.0, it crashed:

net.sqlcipher.database.SQLiteException: file is not a database: , while compiling: select count(*) from sqlite_master; at net.sqlcipher.database.SQLiteCompiledSql.native_compile(Native Method) at net.sqlcipher.database.SQLiteCompiledSql.compile(SQLiteCompiledSql.java:89) at net.sqlcipher.database.SQLiteCompiledSql.<init>(SQLiteCompiledSql.java:62) at net.sqlcipher.database.SQLiteProgram.<init>(SQLiteProgram.java:91) at net.sqlcipher.database.SQLiteQuery.<init>(SQLiteQuery.java:48) at net.sqlcipher.database.SQLiteDirectCursorDriver.query(SQLiteDirectCursorDriver.java:60) at net.sqlcipher.database.SQLiteDatabase.rawQueryWithFactory(SQLiteDatabase.java:2016) at net.sqlcipher.database.SQLiteDatabase.rawQuery(SQLiteDatabase.java:1902) at net.sqlcipher.database.SQLiteDatabase.keyDatabase(SQLiteDatabase.java:2669) at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SQLiteDatabase.java:2599) at net.sqlcipher.database.SQLiteDatabase.openDatabase(SQLiteDatabase.java:1247) at net.sqlcipher.database.SQLiteDatabase.openOrCreateDatabase(SQLiteDatabase.java:1322) at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:166) at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:135) at net.sqlcipher.database.SQLiteOpenHelper.getWritableDatabase(SQLiteOpenHelper.java:131) at org.greenrobot.greendao.database.SqlCipherEncryptedHelper.getEncryptedWritableDb(SqlCipherEncryptedHelper.java:51) at org.greenrobot.greendao.database.DatabaseOpenHelper.getEncryptedWritableDb(DatabaseOpenHelper.java:175)

More Info: 1.Device Detail: Redmi Note 9 (Android 12) 2.I didn't change any code, just upgraded the version to 4.5.0;Before the upgrade, it worked fine.

developernotes commented 1 year ago

Hi @Developmc,

When upgrading from a major version of SQLCipher, there are a few different options available ^1. We reserve GitHub Issues for tracking defects within the software library itself. Please consider posting to the SQLCipher Community Discuss site ^2 if you have any further questions. Thanks!

Developmc commented 1 year ago

Great !