0

过去几天我一直在寻找解决方法,但无济于事。我仅将 Voximplant 用于即时消息 (IM),并希望将 Sinch 用于与其他应用程序的 VOIP 通话。由于 Sinch IM 不适合我们的用例,因此我们将 Voximplant 用于我第一次实现的消息传递。

现在我无法构建,react-native-sinch-voip因为 Voximplant SDK 还包含 VOIP 功能,导致两个库WebRTC在构建过程中在类中发生冲突。

我设法通过重命名 CallManager 类名解决了 iOS 中的冲突,但无法为 Android 解决。

Execution failed for task ':app:checkDebugDuplicateClasses'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckDuplicatesRunnable
   > Duplicate class org.webrtc.AddIceObserver found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.AndroidVideoDecoder found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.AndroidVideoDecoder$1 found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.AndroidVideoDecoder$DecodedTextureMetadata found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.AndroidVideoDecoder$FrameInfo found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.AudioDecoderFactoryFactory found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.AudioEncoderFactoryFactory found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.AudioProcessingFactory found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.AudioSource found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.AudioTrack found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.BaseBitrateAdjuster found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.BitrateAdjuster found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.BuiltinAudioDecoderFactoryFactory found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.BuiltinAudioEncoderFactoryFactory found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
     Duplicate class org.webrtc.CallSessionFileRotatingLogSink found in modules jetified-sinch-android-rtc-4.8.6+b14862c-runtime (sinch-android-rtc-4.8.6+b14862c.aar) and jetified-voximplant-sdk-2.27.0-runtime (com.voximplant:voximplant-sdk:2.27.0)
...

我已经尝试了几种建议的解决方案,将以下代码添加到app/build.gradle但无法正常工作。不确定我是否也使用了正确的语法。我对原生Android不熟悉,因此寻求帮助。

implementation(project(':react-native-voximplant')){
    exclude group: 'com.voximplant', module:'org.webrtc.*'
}
configurations {
    all*.exclude module: 'org.webrtc.AndroidVideoDecoder'
}
4

1 回答 1

0

不幸的是,无法将 Voximplant React Native SDK 与其他基于 WebRTC 的 SDK 一起使用。Voximplant SDK 基于带有额外补丁的特定版本的 WebRTC 库,从 Voximplant Android SDK 中排除 WebRTC 本机库将导致未定义的行为。

我们目前正在对 Voximplant SDK 进行重大更新,这将允许在不依赖 WebRTC 的情况下使用 Voximplant 消息传递 API,但是完成此版本需要几个月的时间。

于 2022-01-12T18:22:46.943 回答