bgfx: could not load library "libc++_shared.so"
java.lang.UnsatisfiedLinkError: dlopen failed: could not load library "libc++_shared.so" needed by "libexample-00-helloworldRelease.so"; caused by library "libc++_shared.so" not found
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 18 (8 by maintainers)
@hellojql that’s how android works, if your shared library needs any other shared library, you need to load it from Java, so just create proxy activity like this:
and refer your %pkg_name%.%activity_name% in
<activity android:name=
field in android manifest instead of NativeActivity there.android.app.lib_name
still needs to point to app’s so file.For me I made it work by coping
C:\Users\%username%\AppData\Local\Android\sdk\ndk-bundle\sources\cxx-stl\llvm-libc++\libs\%platform%\libc++_shared.so
together in .apkAlso check in
bx/scripts/toolchain.lua
there are this lines:By default it only builds for android-24 (which is 7.0+) and might be a bit new to your device.
I’m not sure why we need shared c++ lib in a first place though.
@hellojql yeah it should, my current one on Windows:
thank you @jimon
@jimon Thanks for replying here! 👍
@hellojql yes, as I said, if you compile with android-24 and run on anything below 7.0 you will get
__aeabi_memclr4 not found
error. So: lookup your android version on a phone/tablet, convert it to API level here https://source.android.com/source/build-numbers and place correct value in bx/scripts/toolchain.lua, after that it should work.PS. one line got dropped, there are this lines in toolchain file:
just replace android-24 with whatever android-XX is corresponding to your device OS version, or use with-android option to pass this value externally