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

[android] objectbox binaries with shared libc++ #1009

Open
andrew-ld opened this issue Oct 3, 2021 · 2 comments
Open

[android] objectbox binaries with shared libc++ #1009

andrew-ld opened this issue Oct 3, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@andrew-ld
Copy link

my application includes other native binaries that depend on libc++, it would be nice if you distributed objectbox binaries without libc++ statically linked so as to reduce the binary size and ram usage.

Describe the solution you'd like
android ndk allows you to switch between static and dynamic libc++ in a simple way
https://developer.android.com/ndk/guides/cpp-support

@andrew-ld andrew-ld added the enhancement New feature or request label Oct 3, 2021
@greenrobot-team
Copy link
Member

Thanks for the suggestion. However the docs you link specifically warn against using the shared runtime for JNI libraries distributed through an AAR, like ObjectBox for Android does.

Caution: JNI libraries distributed with Java AARs must not use the shared runtime to avoid conflicting with other libraries and the app.

https://developer.android.com/ndk/guides/cpp-support#shared_runtimes

So I don't think this is possible?

@greenrobot-team greenrobot-team added the more info required Further information is requested label Oct 4, 2021
@andrew-ld
Copy link
Author

andrew-ld commented Oct 4, 2021

yes, I am aware of the drawbacks of having multiple libraries sharing the same libc++ shared library, especially if the final developers are not careful to build all libraries with the same version of ndk and libc++.

Personally, I manually rebuild each library with native code for my app and it's a pity to have done all this work on so many libraries and stay with static libc++ only for objectbox.

tldr:
So I don't think this is possible?
is possible but only not recommended if you do not know what you are doing.

@no-response no-response bot removed the more info required Further information is requested label Oct 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants