0

First time on SO. I am new to Flutter and I have created an SQLite database ‘fmp.db’ in Android Studio 4.1.1 on Mac (Catalina). If I use ‘View->Tool Windows ->Database inspector’ I can see all the tables and the data inside those tables but if I get the file ‘fmp.db’ from device explorer and save it to examine it with SqLiteStudio (3.2.1) I can see the tables but they are all empty with the exception of 2 tables that I populated in the database _onCreate event from a json in a ‘json’ folder. Now the same database created on a PC with Android Studio 4.1.1 when examined on the Mac with SQliteStudio is showing all the data inside the tables. I tried with DB Browser for SQLite on the Mac and same problem. I can only see those tables that were populated in the ‘_onCreate’ event. The application using this database is working fine on the Mac and can access all the information in all the tables.

Anyone has seen this before? Thank you for your attention, Denis Prince

  • Maybe there is another database, in a different file? – Googie Mar 04 '21 at 00:59
  • Thank you @Googie. I deleted the database file, uninstalled the application but still no change. SQLiteStudio can open the database, see the 15 tables, but will only display those 2 tables populated in the _onCreate event of the database. What is strange is that I can see everything with Database Inspector. It is like everything added through user interaction does not appear in the tables. Any other idea? – user1690480 Mar 04 '21 at 13:42
  • It looks like the file that you're opening with SQLiteStudio is not the same as one viewed with Database Inspector. How are you sure that what you download with Device Explorer is the same as what you view in Database Inspector? – Googie Mar 05 '21 at 14:07
  • I agree. I first created an Android Emulator for the Pixel 2 XL on the Mac. I then install the application and start entering data. Then I open Device File explorer and go to the folder \data\data\net.fmp.fmp_mobile\fmpData.db and 'Save as..' in the Documents folder. I then open this file with SQLiteStudio. – user1690480 Mar 05 '21 at 17:26
  • How are you sure that `\data\data\net.fmp.fmp_mobile\fmpData.db` is the database that you see in the application? I'm not familiar with Flutter nor with Android development. I'm only trying to guide you to narrow down the possible spot when the difference happens. SQLiteStudio is not hiding anything, it just shows the database as is, so I'm trying to let you find, where the data actually is and where it is not. – Googie Mar 06 '21 at 18:45
  • 1
    @Googie You were right. I had more than one database in the list so I deleted them all and saved the database from my emulator in the 'Documents' folder and added this database. I can now view the contents of all the tables! Thank you again for your help. – user1690480 Mar 06 '21 at 21:39

0 Answers0