Conflicting native Shared Object (.so) library file - libc++_shared.so

Hi, could you please help me in how to solve this particular error?

Hi,

You could try this:

  1. Find a dependency in your project that has libc++_shared.so. In my case it was react-native.aar.
  2. AAR is just a regular zip archive, so you can unpack it and take all libc++_shared.so files.
  3. Unpack mobilertc.aar and replace its libc++_shared.so files with files from step 2.
  4. Now you can zip the result back to mobilertc.aar and use it in your project.
1 Like

Hi @sa159871 (and thanks @minyushov for helping out!),

Please let me know if you are still encountering any issues after trying the steps in the previous reply and I will be happy to help. :slightly_smiling_face:

Thanks!

Hi @jon.lieblich I just followed these steps and still unable to fix it.
Is there any other fix for it?

Hi @haider.saleem, thanks for using the dev forum.

Can you please provide the exact error that you are seeing?

Thanks!

@jon.lieblich Here it is

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

@haider.saleem

Please add packagingOptions to the build.gradle of your application module like this:

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

@minyushov
Thanks but this solution leads to other issue, while using it when I run app it gets crashed.

@minyushov Will you please let me know React-Native version, you are using?

Hi @haider.saleem,

Can you please post the stack trace of the crash you are seeing after trying out the solution provided by @minyushov ?

Thanks!

@haider.saleem
We are using React Native 0.61.5 and 0.63.4.

1 Like

Hi @haider.saleem,

btw, if you are using React Native, the whole process of adding Zoom into RN is documented pretty well in this article from December (from me). There is also separate part for iOS integration + link to repo:

https://stefanmajiros.medium.com/how-to-integrate-zoom-sdk-into-react-native-47492d4e46a6

From first look, I guess you forgot to init the .so library with Soloader.loadLibrary() method (if the app crashes in runtime - this was happening also to me).

1 Like

Hi @majirosstefan ,
Thank you for providing this solution, it worked well.

The error I was having after using @minyushov provided solution was

assertion “terminating with uncaught exception of type std::bad_cast: std::bad_cast” failed

and it got resolved by solution provided by @majirosstefan

SoLoader.loadLibrary("zoom");

in MainApplication → onCreate

:muscle: :muscle: I am glad it worked.

The following command is also helpful. It simply removes that shared library from mobilertc.aar, which allows the loader to find the one it needs:

zip -d mobilertc.aar \*libc++_shared.so

Thanks for sharing the workarounds, they are appreciated! :blue_heart:

Hi @minyushov , I’m having the stated issue with Android 11 device but its working fine with others

SoLoader: couldn’t find DSO to load: libjscexecutor.so caused by: dlopen failed: cannot locate symbol “__cxa_bad_typeid” referenced by “…/lib/x86_64/libjsc.so”

I’ve tried to repack mobileRTC with new react native libc++_shared but failed, I guess they are using custom libc++_shared.so.

Is there any workaround?

Hi,
Did you run into the following error at SoLoader.loadLibrary("zoom") ?

java.lang.UnsatisfiedLinkError: couldn’t find DSO to load: libzoom.so

I’m using it exactly the way you did in your guide.

1 Like

In case anyone using our Video SDK comes across this thread, another topic has been created for this issue within the #mobile-video-sdk:android category. :slightly_smiling_face: