We are getting the below exception,
result = {SQLiteException@16106} "net.sqlcipher.database.SQLiteException: unable to close due to unfinalized statements or unfinished backups: sqlite3_close() failed"
backtrace = null
cause = {SQLiteException@16106} "net.sqlcipher.database.SQLiteException: unable to close due to unfinalized statements or unfinished backups: sqlite3_close() failed"
detailMessage = "unable to close due to unfinalized statements or unfinished backups: sqlite3_close() failed"
stackTrace = {StackTraceElement[207]@16114}
suppressedExceptions = {Collections$EmptyList@16112} size = 0
shadow$_klass_ = {Class@11331} "class net.sqlcipher.database.SQLiteException"
shadow$_monitor_ = 0
Please let us know what is the root cause of this issue & how to resolve this?
We are currently using the "android-database-sqlcipher-4.5.0.aar"
library version in our application.
Thank You …!
Hi @Nikith_BR
What code/SQL statements are being run around/prior to the exception. Can you reproduce the issue in isolation, possibly via the SQLCipher for Android test suite?
On calling the below method of the SQLiteOpenHelper.class
we are getting the exception,
public synchronized SQLiteDatabase getWritableDatabase(String password) {
return this.getWritableDatabase(password == null ? null : password.toCharArray());
}
I am not aware how to reproduce the issue in isolation via the SQLCipher for Android test suite. So please let me know how to do that? Thank you…!
Hi @Nikith_BR
From the partial stack trace it appears the database connection is attempting to be closed. Unfortunately, that is not enough information to diagnose the root cause. I would suggest that you review the application code to see what is occurring before this error is reported, specifically around the interaction with the database library. You might need to start with the call stack reported from the exception to review the application source in question.
Please check below mentioned logs & let us know is that sufficient to find the root cause?
Caused by net.sqlcipher.database.SQLiteException: unable to close due to unfinalized statements or unfinished backups: sqlite3_close() failed
at net.sqlcipher.database.SQLiteDatabase.dbclose(SQLiteDatabase.java)
at net.sqlcipher.database.SQLiteDatabase.openDatabaseInternal(SQLiteDatabase.java:2632)
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 com.sample.database.SQLiteConnector.openDatabase(SQLiteConnector.java:78)
at com.sample.database.SQLiteConnector.access$000(SQLiteConnector.java:18)
at com.sample.database.SQLiteConnector$DatabaseLoader.doInBackground(SQLiteConnector.java:96)
at com.sample.database.SQLiteConnector$DatabaseLoader.doInBackground(SQLiteConnector.java:83
Hello @Nikith_BR
No, unfortunately, the stack trace alone is not enough information to determine the root cause of your crash. You will need to analyze what your application is doing, likely with the SQLiteConnector
which is not part of SQLCipher for Android to determine further information/cause.