After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757732 - Failure to load gstreamer_android.so on Android >= 6.0
Failure to load gstreamer_android.so on Android >= 6.0
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: cerbero
1.6.1
Other other
: Normal blocker
: 1.6.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
: 758429 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2015-11-07 13:16 UTC by alex
Modified: 2015-11-21 04:42 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch for adding SONAME to gstreamer_android.so (1.53 KB, patch)
2015-11-07 16:17 UTC, alex
committed Details | Review

Description alex 2015-11-07 13:16:41 UTC
Due to the latest changes in Android 6.0 runtime (http://developer.android.com/intl/ko/about/versions/marshmallow/android-6.0-changes.html#behavior-runtime)

Each module should explicitly define it's SONAME. since the building scripts for building android_gstreamer.so don't define soname the library is built without one. This will cause a failure in loading any library that uses libgstreamer_android.so.

E/AndroidRuntime: java.lang.UnsatisfiedLinkError: dlopen failed: library "./obj/local/armeabi-v7a/libgstreamer_android.so" not found
E/AndroidRuntime:     at java.lang.Runtime.loadLibrary(Runtime.java:372)
E/AndroidRuntime:     at java.lang.System.loadLibrary(System.java:1076)

The quick fix is to add: 

TARGET_LDFLAGS := -Wl,-soname,libgstreamer_android.so

in your Android.mk file before calling:
include $(GSTREAMER_NDK_BUILD_PATH)/gstreamer-1.0.mk

The appropriate fix should be to change GSTREAMER_LD in gstreamer-1.0.mk:

GSTREAMER_LD                  := -fuse-ld=gold

with:

GSTREAMER_LD                  := -fuse-ld=gold -Wl,-soname,libgstreamer_android.so
Comment 1 Sebastian Dröge (slomo) 2015-11-07 13:56:39 UTC
Do you want to provide a patch against cerbero for that? What you propose there makes sense and should be done :)
Comment 2 alex 2015-11-07 16:17:57 UTC
Created attachment 315055 [details] [review]
Patch for adding SONAME to gstreamer_android.so
Comment 3 alex 2015-11-07 16:22:43 UTC
(In reply to Sebastian Dröge (slomo) from comment #1)
> Do you want to provide a patch against cerbero for that? What you propose
> there makes sense and should be done :)

Gladly :) I have commited against the 1.6 branch.

BTW: in http://cgit.freedesktop.org/gstreamer/sdk/cerbero/
the clone link: git://anongit.freedesktop.org/gstreamer/sdk/cerbero points to a legacy cerebro repository which is not updated - it should point to the correct repository, it is confusing otherwise :).
Comment 4 Nicolas Dufresne (ndufresne) 2015-11-07 16:42:27 UTC
(In reply to alex from comment #3)
> (In reply to Sebastian Dröge (slomo) from comment #1)
> > Do you want to provide a patch against cerbero for that? What you propose
> > there makes sense and should be done :)
> 
> Gladly :) I have commited against the 1.6 branch.
> 
> BTW: in http://cgit.freedesktop.org/gstreamer/sdk/cerbero/
> the clone link: git://anongit.freedesktop.org/gstreamer/sdk/cerbero points
> to a legacy cerebro repository which is not updated - it should point to the
> correct repository, it is confusing otherwise :).

http://cgit.freedesktop.org/gstreamer/cerbero/

and 

http://cgit.freedesktop.org/gstreamer/sdk/cerbero/

Are symlinks it seems (exactly the same). The legacy one was in gstreamer-sdk/cerbero. Not sure why we have that symlink, we should probably remove it now.
Comment 5 Sebastian Dröge (slomo) 2015-11-07 18:25:45 UTC
Thanks, merged into cerbero master and 1.6 branch. The fix will be included in 1.6.2.

commit cb9825cfcd1cc585f3cad8e9c5dd1f1c21e404f6
Author: Alex Dizengof <alex@ireporty.com>
Date:   Sat Nov 7 18:09:34 2015 +0200

    android: Add SONAME to libgstreamer_android.so for compatibility with Android >= 6.0
    
    Due to the latest changes in Android 6.0 runtime (http://developer.android.com/intl/ko/about/versions/marshmallow/android-6.0-changes.html#behavior-runtime)
    Each module should explicitly define it's SONAME. since the building scripts for building android_gstreamer.so doesn't define soname the library is built without one.
    This will cause a failure in loading any library that uses libgstreamer_android.so.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=757732
Comment 6 Sebastian Dröge (slomo) 2015-11-21 04:42:50 UTC
*** Bug 758429 has been marked as a duplicate of this bug. ***