In Android Pie, when I do a db.rawQuery it throws an exception "SQLite Error: No such table available". The same piece of code works in Android Oreo and below. I have tried in multiple devices and it fails only in Android Pie.
Code :
String selectQuery = "SELECT count(*) FROM people";
SQLiteDatabase db = this.getReadableDatabase();
Cursor cursor = db.rawQuery(selectQuery, null); // Exception happens here
I have 3 DB files for my application. The db file which i have problem is downloaded from my server. It is downloaded as zip file, unzipped and then i will use it. On device explorer of the Android Studio, I am able to find the DB inside "/data/data/packagename". I have downloaded the DB from Android studio file explorer and verified the DB file locally it has all the proper data.
What could be the problem?