Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Godot editor on android doesn't copy over dependencies whent they're located on sdcard. #87785

Closed
lemonJumps opened this issue Jan 31, 2024 · 7 comments · Fixed by #88381
Closed

Comments

@lemonJumps
Copy link

Tested versions

  • Tested in: 4.2.1

Most likely occurs in all versions due to dependencies not being touched by the code that loads a library.

System information

Godot v4.2.1stable - Android - Vulcan (Mobile) - integrated Adreno (TM) 619 - (8 Threads)

Issue description

When opening a project with gdextension in the android editor, that is located on an sdcard, the gdextension file is copied over into a cache, however other dependencies are not copied over, causing the library to not load.

Steps to reproduce

Have a single project with one GDExtenension library, and another library that is its dependency next to it, and a Gdextension file that has both library and dependency describet inside of it.

With this project placed onto an android phone, opening it will cause the error.

Minimal reproduction project (MRP)

Here's a minimal project, (I've used the library which I'm currently using and is causing the issue, but it's in total over 10 MB): https://github.com/lemonJumps/gdextension-bug

@m4gr3d
Copy link
Contributor

m4gr3d commented Feb 15, 2024

@lemonJumps Can you update the minimal project and make the shared library use a relative path when loading its dependencies; for example dlopen("./libopencv_calib3d.so", ...) instead of dlopen("libopencv_calib3d.so", ...)

The app is unable to update the LD_LIBRARY_PATH path on Android, which prevents your shared library from finding its dependencies after they are copied.

@m4gr3d
Copy link
Contributor

m4gr3d commented Feb 16, 2024

@lemonJumps I've added a draft PR in #88381. Once you're able to update your MRP, I can validate that it works as expected.

@lemonJumps
Copy link
Author

@lemonJumps I've added a draft PR in #88381. Once you're able to update your MRP, I can validate that it works as expected.

thanks! I'll update it as soon as i can. life is currently very hectic, so it might take me a week or so. I'll let you know once i do it \o/

@BSChad
Copy link

BSChad commented Apr 19, 2024

I know it's not an MRP, but https://github.com/alessandrofama/fmod-for-godot also suffers from this issue and could be used in testing. (It's the one that made me search out and try to find this!)

@m4gr3d
Copy link
Contributor

m4gr3d commented Apr 19, 2024

I know it's not an MRP, but https://github.com/alessandrofama/fmod-for-godot also suffers from this issue and could be used in testing. (It's the one that made me search out and try to find this!)

Thanks @BSChad! Do you see any specific errors when trying to use the the fmod plugin besides not loading?

@BSChad
Copy link

BSChad commented Apr 19, 2024

I know it's not an MRP, but https://github.com/alessandrofama/fmod-for-godot also suffers from this issue and could be used in testing. (It's the one that made me search out and try to find this!)

Thanks @BSChad! Do you see any specific errors when trying to use the the fmod plugin besides not loading?

Nope. The error is that it can't find libfmod, which is the compiled library that the extension library is trying to load.

@m4gr3d
Copy link
Contributor

m4gr3d commented Apr 19, 2024

Screenshot_20240419_074723_Godot Editor 4 (debug)

@BSChad I've tested with the changes from the PR, and the plugin now loads fine!

@akien-mga akien-mga added this to the 4.3 milestone Apr 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants