2

I am trying to user both MediaSoup and WebRTC libraries in my app. Separately it works flawlessly, but when trying to add both in the same project I have some conflicts.

It's either:

  1. I add both mediasoup ('org.mediasoup.droid:mediasoup-client:3.0.8-beta-3') and webRTC ('org.webrtc:google-webrtc:1.0.32006') in my project, I can sync my gradle. But when trying to build the project, I get an error saying that I got a lot of duplicated class, as such: Duplicate class org.webrtc.AndroidVideoDecoder found in modules jetified-google-webrtc-1.0.32006-runtime.jar (org.webrtc:google-webrtc:1.0.32006) and jetified-mediasoup-client-3.0.8-beta-3-runtime.jar (org.mediasoup.droid:mediasoup-client:3.0.8-beta-3)

  2. I add only WebRTC library: impossible to use MediaSoup so not a solution

  3. I add only MediaSoup. So far I can compile and even build my app, but it crashes on the first statement where I use WebRTC, on: PeerConnectionFactory.initialize() AS is telling me that the native lib is not found: java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file ".../base.apk"],nativeLibraryDirectories=[/data/app/dev.arvuz-fuhAdJV_sT2-PQyEHP0vxg==/lib/arm64, /data/app/dev.arvuz-fuhAdJV_sT2-PQyEHP0vxg==/base.apk!/lib/arm64-v8a, /system/lib64]]] couldn't find "libjingle_peerconnection_so.so"

So, that's where I am stuck. How (is it even possible?) to use WebRTC in combination with MediaSoup libraries on Android? I tried excluding some WebRTC module in my gradle file but couldn't achieve anything.

Anael
  • 417
  • 1
  • 6
  • 18

1 Answers1

0

It's possible that the MediaSoup and webRTC dependencies are using different versions of the same library code under the hood. The namespace of these different versions could collide at runtime when the JVM tries to lookup some native method that's only present in one of the versions. If this is the case, you must use the version of MediaSoup and webRTC that share the same library version.