2shady4u / godot-sqlite

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

Error when exporting to Android #144

Open artiko99-b1 opened 1 year ago

artiko99-b1 commented 1 year ago

Environment:

Issue description: When I export to android I get the error "No suitable library found for GDExtension: res://addons/godot-sqlite/gdsqlite.gdextension. Possible feature flags for your platform: mobile, android, etc2, astc, arm64, arm64-v8a, template, debug, template_debug" I can install the generated APK/AAB file on android but the Sqlite functions are ignored so the app on mobile does not work.

What I have found out: I have looked in the gdsqlite.gdextension file and I have seen that it does not have the libraries it should use for android. It doesn't have the depencies either. I have edited the file adding the missing entries and now the Android export works correctly. Please correct the gdsqlite.gdextension file with the missing entries.

2shady4u commented 1 year ago

I will add the binaries to the gdsqlite.gdextension-file ASAP. To speed up this process, would it be possible to show me the missing entries that you added?

artiko99-b1 commented 1 year ago

These are the missing entries that I´ve added to gdsqlite.gdextension file: In [libraries] section: android.arm64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_debug.arm64.so" android.template_release.arm64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_release.arm64.so" android.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_debug.x86_64.so" android.template_release.x86_64 = "res://addons/godot-sqlite/bin/libgdsqlite.android.template_release.x86_64.so"

In [dependencies] section: android.arm64 = {} android.template_release.arm64 = {} android.x86_64 = {} android.template_release.x86_64 = {}

That's all.

Labanazario commented 1 year ago

@artiko99-b1 but you managed to make the database work after that? Like read/write to the db in Android, because in my case it wont work even if I do this gdextension modification. It exports but do not actually work when reading something from the db.

artiko99-b1 commented 1 year ago

@Labanazario My database is read-only. I don't have to copy it to the user:// folder. Before the fix, I was getting the error mentioned in the first post, and the version exported to my Android device was unusable. Now it works as expected.

2shady4u commented 1 year ago

@artiko99-b1 Adding these library entries to the gdsqlite.gdextension-file doesn't seem to be sufficient to make it work on Android on my end:

ERROR: No suitable library found for GDExtension: res://addons/godot-sqlite/gdsqlite.gdextension. Possible feature flags for your platform: mobile, android, etc2, astc, arm32, armeabi-v7a, arm64, arm64-v8a, template, debug, template_debug
   at: (./editor/plugins/gdextension_export_plugin.h:114)

The latest gdsqlite.gdextension-file can be found here.

vtgreybeard commented 11 months ago

Fwiw, I am getting the exact same error when exporting to Android: No suitable library found for GDExtension: res://addons/godot-sqlite/gdsqlite.gdextension. Possible feature flags for your platform: mobile, android, etc2, astc, arm32, armeabi-v7a, arm64, arm64-v8a, template, debug, template_debug

I am using the stock/provided gdsqlite.gdextension file as well.

Also, it did previously export properly when I was using Godot v4.0.1 with an (unknown) previous version of this plugin.

cyberpuffin-digital commented 11 months ago

I hit this issue when exporting for Android as well (Godot 4.1.1, godot-sqlite 4.2). If I understand the issue correctly, it's because there is no binary for the 32 bit Android architectures (armeabi-v7a and x86). Once I removed those target architectures from my build, everything worked as expected. I can read and write databases in the user space on my builds.