My data don't get written to sqlite from screen login. I use the same setup in screen1 and there it works.
The strangest thing is that I have managed to store data once from the login screen after setting file permissions (that magically turned off). Thought that solved it, but afterwards could not reproduce the result.
Can it be that the problem is that I don't use Screen1?
Looks like it is not happy working directly with the database in /Documents (not sure why, will need to investigate further). However you can import that database to the default database, work with it, then export it again once finished.
Seems to work OK if the db is saved/exported to the ASD, then set as DBName with that path, but not for paths to shared storage, possibly an Android 13 thing I have not come across. [EDIT - nope, just wasn't in the extension - fixing]
This error also happened to me. I found it happens if we uninstall the app then reinstall it.
or if we delete the db then install again.
and it will return to normal if the DB name in the asset is changed then rebuilt then installed again
I first like to thank TIMAI2 for this extension SimpleSQLite., very crucial for Database related access, moreover it has been given free to everyone.
Now the problem:
There is SimpleSQLite in Screen1, when SimpleSQLite is added to Screen2 or Screen3, then The app freezes, while trying to open Screen2 or Screen3 .
I suppose SimpleSQLite is unique to every Screen. I don't know why it happens?
Don't remember this being an issue previously, not heard of this before. I have tested a 3 screen project in companion, with SimpleSqlite loaded in each screen (not doing anything) and I see no crashing.
Are you closing/unloading databases before switching screens ?
Do you need multiple real screens, you could probably use virtual screens for your app
Why are you using V2 of SimpleSQLite? Use the latest version V4 which includes the listFixer method along with other improvements.
You appear to have got yourself into a muddle. You only have one bible database, so why does the user have to pick a file from Shared Directories ? Just import it to the main database from assets and work from there, or as I did in my previous example, download it to your ASD and set the filepath there.
Different real screens should be considered as different apps, you need to ensure you close the database on one screen before loading and opening the database on another. This I why I suggested virtual screens.
I'm encountering a problem with the return values from what appears to be the sql.run function. It seems that if the query finds matching records, the function correctly returns the data. But if no records are found, it returns the string "SQL command completed" instead of an empty list.
This makes the data handling logic more complicated, as I have to check the result type before processing it.
What is the recommended way to handle this scenario? I was expecting an empty list for a query with no results.