2shady4u / godot-sqlite

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

Does not work on android with custom template #53

Closed spyr0s closed 3 years ago

spyr0s commented 3 years ago

Environment:

Issue description: When building for android using a custom template i got the error Can't open dynamic library: libgdsqlite.so, error: dlopen failed: library "libgdsqlite.so" not found. and the plugin does not work

Steps to reproduce: Install android custom templates and export the project for android

2shady4u commented 3 years ago

Hello @spyr0s

Just to confirm: exporting for Android without using a custom template works without any problems?

spyr0s commented 3 years ago

Yes, it works fine. I fixed it by copying the contents of /addons/godot-sqlite/bin/android

inside android/build/libs/(debug|release) folders but i'm sure that's not an optimal way

Tried adding the paths in build.gradle

debug.jniLibs.srcDirs = [
            'libs/debug',
            '../../addons/godot-sqlite/bin/android'
//DIR_JNI_DEBUG_BEGIN
//DIR_JNI_DEBUG_END
        ]
        release.jniLibs.srcDirs = [
            'libs/release',
        '../../addons/godot-sqlite/bin/android'

with no luck

Maybe is a godot bug, it should scan addons and copy the lib files itself? or maybe the plugin can define the resources to bundle? https://docs.godotengine.org/en/stable/tutorials/plugins/android/android_plugin.html#bundling-gdnative-resources

2shady4u commented 3 years ago

Latest Dev snapshot seems to address some of these issues that you are having?

image

Relevant PR: https://github.com/godotengine/godot/pull/49911

Could you check if you have the same issue with Godot 3.4?

spyr0s commented 3 years ago

Yes, it worked with godot 3.4 beta 2 👍

2shady4u commented 3 years ago

@spyr0s I'll leave this issue open until Godot 3.4 has been released. would you be willing to give a small code snippet or explanation on how to add the plugin to custom Android builds?

Are there any other issues that haven't been solved by Godot 3.4?

spyr0s commented 3 years ago

I just copied the folders arm64-v8a armeabi-v7a x86

from addons/godot-sqlite/bin/android to android/libs/debug and android/libs/release

2shady4u commented 3 years ago

@spyr0s with the release of the new Godot v3.3.3 this issue should now have been fixed by the engine. Can you confirm this? and if yes, can you close this issue?

2shady4u commented 3 years ago

I'll consider this issue closed for now... Feel free to re-open this issue if the problem persists.