2shady4u / godot-sqlite

GDExtension wrapper for SQLite (Godot 4.x+)
MIT License
975 stars 83 forks source link

android export not working #146

Closed yohannes-jo closed 1 year ago

yohannes-jo commented 1 year ago

Environment:

Issue description: Database doesn't work on android. I checked the docs and it says to copy db files manually to user:// but that doesn't seem natural if I have to add another step for installing game. Did you mean to say copy it manually like copy-paste to org.godotengine.gamename folder in android/data or do that in code? if the latter one is true, how does one do that? (gdscript)

The plugin works perfectly well on desktop, just not on android.

Steps to reproduce: new project, install plugin make a new sqlite database, verify that the plugin works perfectly on desktop by doing basic CRUD, do the same thing but export for android (see whether it works).

Minimal reproduction project: const SQLite = preload("res://addons/godot-sqlite/bin/gdsqlite.gdns") var db var db_name = "user://question_database" var session_db_name = "user://session_log_database" This is how I labelled the databases and they work fine as res:// on desktop, but even if I change to user:// it won't work.

Additional context None

2shady4u commented 1 year ago

Hello @yohannes-jo

Android stops any applications from modifying the content of the program folder directly.

There's basically two cases:

yohannes-jo commented 1 year ago

Thank you so much, bless you. It worked. I just didn't know how to copy a file inside of code before so thank you.

2shady4u commented 1 year ago

No problem @yohannes-jo ! 😄