3

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

alx
  • 352
  • 1
  • 8
  • Possible duplicate of [SQLiteReadOnlyDatabaseException: attempt to write a readonly database](https://stackoverflow.com/questions/9884969/sqlitereadonlydatabaseexception-attempt-to-write-a-readonly-database) – Amit Vaghela Jun 20 '17 at 04:09
  • It is not duplicated of this issue. We are not any SQLite in our app. it is being caused by firebase. – isudansh Feb 22 '18 at 12:42
  • We're seeing the exact same issue in our app, but mostly with Samsung devices. Were you able to find a fix or a workaround? – timbremer Jul 01 '18 at 09:03
  • I am also facing this issue. Are you able to solve ? – Ali Ahmed Jan 16 '19 at 06:50

0 Answers0