1

I have an app where all the data are provided from a pre-populated data base. I opted to use Room database and everything works fine below Android API 25, but then on 25, ..., 28, it seems that the data isn't read at all. There isn't any warning or relevant info in logcat.

This is how I'm initializing the Room Database:

INSTANCE = Room.databaseBuilder(context,
                    RoomBibleDatabase.class, "My_Database")
                    .allowMainThreadQueries() // Just for testing...
                    .build();

My pre-populated database file is in src/main/assets/My_Database .

I've tried some different things including adding permissions for reading/writing on my Manifest.xml file:

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

It's being really frustrating to solve this, since I don't have any error or warnings feedback.

Can anyone tell me if is there any restriction from Android API versions, or do you have any other suggestion for why this is happening?

Thanks in advance!

Daniel Beleza
  • 389
  • 1
  • 15
  • Try https://stackoverflow.com/questions/50476782/android-p-sqlite-no-such-table-error-after-copying-database-from-assets. – ADM Feb 10 '19 at 13:46
  • Thanks for the suggestion. As I mentioned, my only problem is Room database, not sqlite. Everything goes on like expected (Splash Screen start etc...) but when I get data, the list I'm supposed to receive, returns me 0 results. The moment I run my app on API 24, for example, everything is fine and I have all the expected results. – Daniel Beleza Feb 10 '19 at 14:43

0 Answers0