Error 26 generally means that the database can’t be opened due to encryption key mismatch or lack of encryption support. Here are a few specific reasons:
- The encryption keys do not match. Please verify that the same key value us used every time the application is opening the database.
- SQLCipher is not actually being used - to verify this, in your application code execute the statement
PRAGMA cipher_version
and check the result set. Verify that a version is being returned. If you don’t get a result set then SQLCipher is not actually be used at runtime. - Major versions don’t match, i.e. opening a SQLCipher 3 database with SQLCipher 4.
- Opening an unencrypted database with a key - How to encrypt a plaintext SQLite database to use SQLCipher (and avoid “file is encrypted or is not a database” errors)