We recently added Firebase to our app and noticed a high increase of SQLite exceptions.
Logs:
android.database.sqlite.SQLiteReadOnlyDatabaseException: at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method:0) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:788) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1474) at bkf.a(:com.google.android.gms.DynamiteModulesC:70) at bkw.run(:com.google.android.gms.DynamiteModulesC:32) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:761)>
or
android.database.sqlite.SQLiteDiskIOException: at android.database.sqlite.SQLiteConnection.nativeExecuteForLastInsertedRowId(Native Method:0) at android.database.sqlite.SQLiteConnection.executeForLastInsertedRowId(SQLiteConnection.java:788) at android.database.sqlite.SQLiteSession.executeForLastInsertedRowId(SQLiteSession.java:788) at android.database.sqlite.SQLiteStatement.executeInsert(SQLiteStatement.java:86) at android.database.sqlite.SQLiteDatabase.insertWithOnConflict(SQLiteDatabase.java:1472) at bkf.a(:com.google.android.gms.DynamiteModulesC:70) at bkw.run(:com.google.android.gms.DynamiteModulesC:46) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) at java.lang.Thread.run(Thread.java:761)
In our app we're using SQLite too (multiple threads, single instances of SQLiteOpenHelper), however we don't get any exceptions there. We also noticed that these exceptions were thrown for about 90% on Sony devices. (SDK 23 and above)
Which comes first in my mind, is a failed SQLite implementation on these devices but I'm not able to reproduce it on our Sony devices, so my questions are:
- is this a known Firebase issue?
- can anyone confirm my guess?
and well,
- what will be a possible workaround
Any help would be appreciated.
Edit: For sure it's related to SQLiteReadOnlyDatabaseException (it's mentioned in the logs ;) ) but it affects mostly Sony devices and it's not our db which fails but Googles, so I don't think it's duplicated to SQLiteReadOnlyDatabaseException: attempt to write a readonly database