react-native-webrtc / react-native-webrtc

The WebRTC module for React Native
https://react-native-webrtc.discourse.group
MIT License
4.59k stars 1.23k forks source link

Duplicate Class Conflict: GeckoView with React Native WebRTC #1627

Open thelonewolf123 opened 6 hours ago

thelonewolf123 commented 6 hours ago

Description: I'm attempting to use GeckoView in conjunction with react-native-webrtc, but I am encountering duplicate class issues with the WebRTC libraries. Below are the details of the conflicts:

Duplicate class org.webrtc.AddIceObserver found in:
- geckoview-106.0.20221102214123.aar -> jetified-geckoview-106.0.20221102214123-runtime (org.mozilla.geckoview:geckoview:106.0.20221102214123)
- webrtc-124.0.0.aar -> jetified-webrtc-124.0.0-runtime (org.jitsi:webrtc:124.0.0)

Duplicate class org.webrtc.AndroidVideoDecoder found in:
- geckoview-106.0.20221102214123.aar -> jetified-geckoview-106.0.20221102214123-runtime (org.mozilla.geckoview:geckoview:106.0.20221102214123)
- webrtc-124.0.0.aar -> jetified-webrtc-124.0.0-runtime (org.jitsi:webrtc:124.0.0)

Duplicate class org.webrtc.AndroidVideoDecoder$1 found in:
- geckoview-106.0.20221102214123.aar -> jetified-geckoview-106.0.20221102214123-runtime (org.mozilla.geckoview:geckoview:106.0.20221102214123)
- webrtc-124.0.0.aar -> jetified-webrtc-124.0.0-runtime (org.jitsi:webrtc:124.0.0)

Duplicate class org.webrtc.AndroidVideoDecoder$DecodedTextureMetadata found in:
- geckoview-106.0.20221102214123.aar -> jetified-geckoview-106.0.20221102214123-runtime (org.mozilla.geckoview:geckoview:106.0.20221102214123)
- webrtc-124.0.0.aar -> jetified-webrtc-124.0.0-runtime (org.jitsi:webrtc:124.0.0)

This seems to be a conflict between the WebRTC implementations used by GeckoView and Jitsi’s WebRTC library. I am seeking guidance on how to resolve this conflict.

Steps to Reproduce:

  1. Integrate GeckoView and React Native WebRTC into a project.
  2. Build the project.
  3. The build fails with the above duplicate class errors.

Expected Behavior: The build should succeed without class conflicts between GeckoView and the WebRTC libraries.

Environment:

saghul commented 4 hours ago

@davidliu IIRC you guys at LK have a way to prefix the framework, is that so or did I see it elsewhere? If so, how does that work?