godot-sqlite icon indicating copy to clipboard operation
godot-sqlite copied to clipboard

Error when exporting to Android

Open artiko99-b1 opened this issue 1 year ago • 7 comments

Environment:

  • OS: Windows
  • Godot version: 4.0.3
  • godot-sqlite version: 4.0

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.

artiko99-b1 avatar May 26 '23 10:05 artiko99-b1

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?

2shady4u avatar Jun 05 '23 08:06 2shady4u

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.

artiko99-b1 avatar Jun 05 '23 11:06 artiko99-b1

@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.

Labanazario avatar Jun 09 '23 18:06 Labanazario

@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.

artiko99-b1 avatar Jun 09 '23 22:06 artiko99-b1

@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.

2shady4u avatar Jun 18 '23 12:06 2shady4u

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.

vtgreybeard avatar Aug 03 '23 20:08 vtgreybeard

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.

cyberpuffin-digital avatar Aug 21 '23 16:08 cyberpuffin-digital