We have an android app that uses SQLite for some form of persistent storage. The sqlite code works on all devices except Oneplus devices. ( I am testing on Oneplus 2 A2003)
Following is the error that I am seeing in logcat.
android.database.sqlite.SQLiteException: no such table: testtable (code 1): , while compiling: INSERT INTO testtable(ID,CompletedOn,CreatedOn,Type,Pending,Priority,Attributes) VALUES (?,?,?,?,?,?,?)
Following is the piece of database that is used for open database
SQLiteDatabase db = SQLiteDatabase.openDatabase(this.getHelperContext().getDatabasePath(DATABASE_NAME).getAbsolutePath(), null,
SQLiteDatabase.NO_LOCALIZED_COLLATORS);
Have tried even specifying the access rights while opening, but no difference. e.g. SQLiteDatabase.NO_LOCALIZED_COLLATORS | SQLiteDatabase.OPEN_READWRITE
Any help would be appreciated.
Check this answer https://stackoverflow.com/a/33032467/4504324 it solved the issue for me.
Just close the db before copying the sqlite stream into internal database.