react-native-yz-vlcplayer icon indicating copy to clipboard operation
react-native-yz-vlcplayer copied to clipboard

Failed to upgrade to 'com.yyl.vlc:vlc-android-sdk:3.3.0'

Open davinctor opened this issue 4 years ago • 1 comments

I have found that the stream is freezing after some time for different cameras in the project. I'm using react-native-vlcplayer package in the RN app and inside it uses this library my 3.0.10version.

After upgrading from com.yyl.vlc:vlc-android-sdk:3.0.10 to com.yyl.vlc:vlc-android-sdk:3.3.0 it video freezing issue was fixed in the test project but when I'm trying to migrate it to another project I'm receiving this kind of error:

More than one file was found with OS independent path 'lib/x86/libc++_shared.so'

I have found thread in react-native-ffmpeg library with a similar issue. The library maintainer said that it's because of c++ core library was changed in ReactNative core.

libgnustl_shared.so is replaced with libc++_shared.so in react-native 0.59. react-native-ffmpeg already includes libc++_shared.so so using react-native 0.59 causes the More than one file was found with OS independent path 'lib/x86/libc++_shared.so' error.

And have proposed to use the next solution inside your project app/build.gradle file:

packagingOptions {
    pickFirst 'lib/x86/libc++_shared.so'
    pickFirst 'lib/x86_64/libc++_shared.so'
    pickFirst 'lib/armeabi-v7a/libc++_shared.so'
    pickFirst 'lib/arm64-v8a/libc++_shared.so'
}

It started to compile and run but when I'm going to open the stream with VLCPlayer component app crashes with the next error in logs.

E/VLC/LibVLC: Can't load vlcjni library: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "__emutls_get_address" referenced by "/data/app/com.omo.systems-2/lib/arm/libvlc.so"...

Maybe vlcjni trying to use another standard c++ library instead of provided by react-native library.

My RN version in 0.61.5.

I also reported this issue in vlc-sdk-lib.

Thanks in advance!

davinctor avatar Nov 20 '20 13:11 davinctor

@tanersener I know it's definitely not your package but maybe you have some ideas on how to work around it. Thank you in advance!

davinctor avatar Nov 20 '20 13:11 davinctor