WebRTC-iOS: GoogleWebRTC library conflict on IOS 12 to 13.3

GoogleWebRTC ios 12.2 objc[287]: Class RTCCVPixelBuffer is implemented in both /System/Library/PrivateFrameworks/WebCore.framework/Frameworks/libwebrtc.dylib (0x1c29eaf98) and /private/var/containers/Bundle/Application/3057B118-2044-4852-8672-13C9DF6DEC00/WebRTC-Demo.app/Frameworks/WebRTC.framework/WebRTC (0x101604a10). One of the two will be used. Which one is undefined. objc[287]: Class RTCWrappedNativeVideoDecoder is implemented in both /System/Library/PrivateFrameworks/WebCore.framework/Frameworks/libwebrtc.dylib (0x1c0863458) and /private/var/containers/Bundle/Application/3057B118-2044-4852-8672-13C9DF6DEC00/WebRTC-Demo.app/Frameworks/WebRTC.framework/WebRTC (0x101604a60). One of the two will be used. Which one is undefined. objc[287]: Class RTCWrappedNativeVideoEncoder is implemented in both /System/Library/PrivateFrameworks/WebCore.framework/Frameworks/libwebrtc.dylib (0x1c08634a8) and /private/var/containers/Bundle/Application/3057B118-2044-4852-8672-13C9DF6DEC00/WebRTC-Demo.app/Frameworks/WebRTC.framework/WebRTC (0x101604ab0). One of the two will be used. Which one is undefined. objc[287]: Class RTCVideoDecoderVP8 is implemented in both /System/Library/PrivateFrameworks/WebCore.framework/Frameworks/libwebrtc.dylib (0x1c08631b0) and /private/var/containers/Bundle/Application/3057B118-2044-4852-8672-13C9DF6DEC00/WebRTC-Demo.app/Frameworks/WebRTC.framework/WebRTC (0x101604b28). One of the two will be used. Which one is undefined.

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 33 (5 by maintainers)

Most upvoted comments

Temporary solution(use at your own risk):

  1. make work dir
mkdir build_rtc
cd build_rtc
  1. Install the Chromium depot tools
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=`pwd`/depot_tools:"$PATH"
  1. Download webrtc sources
fetch --nohooks webrtc_ios
ls

depot_tools src

cd src
  1. Check and select branches(optional. May skip this step, if you use master branch) 4.1 Check branches
git branch -a

...
remotes/branch-heads/...
  remotes/branch-heads/m73
  remotes/branch-heads/m74
  remotes/branch-heads/m75
  remotes/branch-heads/m76
  remotes/branch-heads/m77
  remotes/branch-heads/m78
  remotes/branch-heads/m79
  remotes/branch-heads/phoglund-test
  remotes/origin/HEAD -> origin/master
  remotes/origin/infra/config
  remotes/origin/lkgr
  remotes/origin/master

4.2 checkout

git checkout remotes/branch-heads/m79
  1. sync
gclient sync
  1. create new local branch
git new-branch local_dev_fix_webrtc
  1. Find and replace “RTCCVPixelBuffer” with some prefix in sources
grep -rl --include=\*.{gn,h,m,mm} "RTCCVPixelBuffer" . | xargs sed -i .bak -e 's/RTCCVPixelBuffer/APPLE_MUST_FIX_IT_RTCCVPixelBuffer/g'
  1. Rename some files
mv ./sdk/objc/Framework/Headers/WebRTC/RTCCVPixelBuffer.h ./sdk/objc/Framework/Headers/WebRTC/APPLE_MUST_FIX_IT_RTCCVPixelBuffer.h
mv ./sdk/objc/components/video_frame_buffer/RTCCVPixelBuffer.h ./sdk/objc/components/video_frame_buffer/APPLE_MUST_FIX_IT_RTCCVPixelBuffer.h
mv ./sdk/objc/components/video_frame_buffer/RTCCVPixelBuffer.mm ./sdk/objc/components/video_frame_buffer/APPLE_MUST_FIX_IT_RTCCVPixelBuffer.mm
  1. Generating project files(arm,arm64,x64 for simulator)
gn gen out/ios_arm --args='target_os="ios" target_cpu="arm" is_debug=false ios_enable_code_signing=false'
gn gen out/ios_arm64 --args='target_os="ios" target_cpu="arm64" is_debug=false ios_enable_code_signing=false'
gn gen out/ios_sim --args='target_os="ios" target_cpu="x64" is_debug=false ios_enable_code_signing=false'

or debug version(is_debug=true)

gn gen out/ios_arm --args='target_os="ios" target_cpu="arm" is_debug=true ios_enable_code_signing=false'
gn gen out/ios_arm64 --args='target_os="ios" target_cpu="arm64" is_debug=true ios_enable_code_signing=false'
gn gen out/ios_sim --args='target_os="ios" target_cpu="x64" is_debug=true ios_enable_code_signing=false'
  1. Compiling with ninja
ninja -C out/ios_arm framework_objc
ninja -C out/ios_arm64 framework_objc
ninja -C out/ios_sim framework_objc
  1. Join all in one “fat” framework
mkdir out/ios
cp -R out/ios_arm64/WebRTC.framework/ out/ios/WebRTC.framework
lipo -create out/ios_arm/WebRTC.framework/WebRTC out/ios_arm64/WebRTC.framework/WebRTC out/ios_sim/WebRTC.framework/WebRTC -output out/ios/WebRTC.framework/WebRTC
  1. Done! resault: out/ios/WebRTC.framework You may create private cocoapod repo and use as pod ‘GoogleWebRTC’, :git => ‘your github repo’

Ref: https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/ios/index.md

apple not solve the problem in release IOS 12.3

so, it fixed in 12.3 beta. I temporary build it from source with rename. Waiting for release ios 12.3.

Xcode 11.4 IOS 13.x has no this issue!! Congratulations!! Xcode 11.4 IOS 12.x getting this issue((

Good news. Xcode 11.4 beta 3 has no problem. But! I hope in the release version, this will completely be fixed(i know issue: beta - no problem, release - problem has present).

@iStorry copy sources with this https://webrtc.org/native-code/ios/ instructions and before you compile that, you have to rename the conflicting functions