简体   繁体   中英

Android Room Database - DB file is empty

Running into a problem here. In the past, I was able to pull the Room DB file from /databases (along with db-shm and db-wal), and then view the table in DB Browser for SQLite. I would use ADB to pull the files to my PC, and then view the tables.

Now (a few months after last doing this), the DB file appears to be empty in SQLite viewer. I know for a fact that it has data (I can programmatically read from it in my app).

I also pulled it using device explorer and got the same result (no tables in db).

Has anyone else noticed this problem or have a solution? I have searched SO, and all of the 'empty db' instances seem to be related to not pulling all three files, or the DB actually being empty. I have all three files, and the db is definitely not empty.

Thanks in advance!

Even after uninstalling the app, and repopulating the DB...it was still showing up as blank.

Tried restarting Android Studio to no avail.

Ended up rm * in /databases from adb shell and relaunching the app. This resolved the issue. I was able to adb pull and view the tables.

Thanks for you input @Al Tegani

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM