-
Notifications
You must be signed in to change notification settings - Fork 9
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
java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found #3
Comments
Hey @sampleref , I think you need something similar to https://gitlab.freedesktop.org/gstreamer/gst-docs/commit/5441a572d99375fb1a74d84dd3d619a8518d484f here. A subsequent PR if this works for you will be very appreciated :) |
Thanks @MathieuDuponchelle I tried to keep the same configuration as mentioned in https://gitlab.freedesktop.org/gstreamer/gst-docs/commit/5441a572d99375fb1a74d84dd3d619a8518d484f but seems its not helping. Somehow the libc++_shared.so is not packaged into .apk file. Going through gstreamer-android unpacked tar as to my understanding it has to be loaded from path
from variable as below,
Here the variable GSTREAMER_ANDROID_CMD is resolved to empty when I logged it during the build. It looks to be loading the path for missing libc++_shared.so from path
But somehow this variable GSTREAMER_ANDROID_CMD := $(call libtool-link... is not resolved and stays empty on build. Is there any lib/tool additionally to be installed to resolve this call libtool-link on Windows 10 machine... ? |
@sampleref I don't quite know what to say here, can you build the tutorials on windows? |
Do you have a |
Thanks @ystreet Yes got it now. Adding dummy.cpp in jni folder actually made the build to include c++ library in apk. I actually missed it assuming just an empty file. _Not quite fully sure how adding this .cpp file enabled build to include libc++shared.so in apk. Any pointers of how this is configured will be helpful for more understanding Now I can install and open app on my android mobile. But when clicking on play button it throws message as
and no video is played. Is it that this android app needs to be allowed for network access? |
Yes I can build this tutorial on windows. I think as updated, missing dummy.cpp was issue. Once adding it apk is packaged with libc++shared.so Thanks |
OK, can you propose a PR? |
afaict this is simply caused by the hardcoded RTSP stream being currently unavailable ( |
Ok I shall try with working rtsp url. Created a PR with changes as working for me at #4 |
Thanks for following up :) |
Hello. I'm trying to test this project but i encounter the same error. Where should i put that dummy.cpp? @sampleref is this correct? |
For me, I have resolved this by adding this line in Application.mk |
I have built this app on android studio on windows 10 PC. Build is successful but when I install and open the app on Mobile with Android 9 arm64-v8a the app throws error as below,
java.lang.UnsatisfiedLinkError: dlopen failed: library "libc++_shared.so" not found
at java.lang.Runtime.loadLibrary0(Runtime.java:1016)
at java.lang.System.loadLibrary(System.java:1669)
at org.freedesktop.gstreamer.rtsp_example.RTSPExample.(RTSPExample.java:122)
at java.lang.Class.newInstance(Native Method)
at android.app.AppComponentFactory.instantiateActivity(AppComponentFactory.java:69)
at android.support.v4.app.CoreComponentFactory.instantiateActivity(CoreComponentFactory.java:43)
at android.app.Instrumentation.newActivity(Instrumentation.java:1216)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2864)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:201)
at android.app.ActivityThread.main(ActivityThread.java:6823)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
I have seen at docs https://developer.android.com/ndk/guides/cpp-support to provide libstdc++_shared.so to be provided explicitly,
but I could not find any simple example of doing it
I tried adding in Application.mk as below to try,
APP_STL := c++_shared
and
APP_STL := c++_static
But issue still happens.
I could see there is no libstdc++_shared.so added to generated apk at path
..android_rtsp_example\app\build\outputs\apk\debug\app-debug.apk\lib\arm64-v8a\
Is this due to same reason that libstd+++shared.so is missing in apk if so how to enable Application.mk/Andoid.mk to have it added to apk?
Or Please let know if there is a different approach to address this issue?
The text was updated successfully, but these errors were encountered: