react-native-webrtc: iOS Release Build - Missing Required Architecture x86_64
Steps to reproduce the problem
Everything works fine in debug mode. When I went to edit scheme -> clicked run option -> changed build configuration to Release and unchecked “debug executable”. I then went to Product -> build.
I have downloaded the bitcode thinking maybe that would solve the issue but it did not.
I tried removing my ios/pods and node_modules directories and installing everything fresh to see if that was the issue, it was not.
Expected behavior
I would expect this to build correctly.
Observerd behavior
ld: warning: ignoring file /Users/tom/bitbybit/mobile/node_modules/react-native-webrtc/apple/WebRTC.xcframework/ios-arm64/WebRTC.framework/WebRTC, missing required architecture x86_64 in file /Users/tom/bitbybit/mobile/node_modules/react-native-webrtc/apple/WebRTC.xcframework/ios-arm64/WebRTC.framework/WebRTC (1 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_RTCMediaConstraints", referenced from:
objc-class-ref in libreact-native-webrtc.a(WebRTCModule+RTCPeerConnection.o)
"_OBJC_CLASS_$_RTCDataBuffer", referenced from:
objc-class-ref in libreact-native-webrtc.a(WebRTCModule+RTCDataChannel.o)
"_OBJC_CLASS_$_RTCDataChannel", referenced from:
__OBJC_$_CATEGORY_RTCDataChannel_$_React in libreact-native-webrtc.a(WebRTCModule+RTCDataChannel.o)
"_OBJC_CLASS_$_RTCMediaStreamTrack", referenced from:
__OBJC_$_CATEGORY_RTCMediaStreamTrack_$_React in libreact-native-webrtc.a(RTCMediaStreamTrack+React.o)
"_OBJC_CLASS_$_RTCIceCandidate", referenced from:
objc-class-ref in libreact-native-webrtc.a(RCTConvert+WebRTC.o)
"_OBJC_CLASS_$_RTCConfiguration", referenced from:
objc-class-ref in libreact-native-webrtc.a(RCTConvert+WebRTC.o)
"_OBJC_CLASS_$_RTCIceServer", referenced from:
objc-class-ref in libreact-native-webrtc.a(RCTConvert+WebRTC.o)
"_OBJC_CLASS_$_RTCPeerConnectionFactory", referenced from:
objc-class-ref in libreact-native-webrtc.a(WebRTCModule.o)
"_OBJC_CLASS_$_RTCDefaultVideoDecoderFactory", referenced from:
objc-class-ref in libreact-native-webrtc.a(WebRTCModule.o)
"_OBJC_CLASS_$_RTCDataChannelConfiguration", referenced from:
objc-class-ref in libreact-native-webrtc.a(RCTConvert+WebRTC.o)
"_OBJC_CLASS_$_RTCEAGLVideoView", referenced from:
objc-class-ref in libreact-native-webrtc.a(RTCVideoViewManager.o)
"_OBJC_CLASS_$_RTCDefaultVideoEncoderFactory", referenced from:
objc-class-ref in libreact-native-webrtc.a(WebRTCModule.o)
"_OBJC_CLASS_$_RTCSessionDescription", referenced from:
objc-class-ref in libreact-native-webrtc.a(RCTConvert+WebRTC.o)
objc-class-ref in libreact-native-webrtc.a(WebRTCModule+RTCPeerConnection.o)
"_OBJC_CLASS_$_RTCPeerConnection", referenced from:
__OBJC_$_CATEGORY_RTCPeerConnection_$_VideoTrackAdapter in libreact-native-webrtc.a(WebRTCModule+VideoTrackAdapter.o)
__OBJC_$_CATEGORY_RTCPeerConnection_$_React in libreact-native-webrtc.a(WebRTCModule+RTCPeerConnection.o)
"_OBJC_CLASS_$_RTCCameraVideoCapturer", referenced from:
objc-class-ref in libreact-native-webrtc.a(VideoCaptureController.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Platform information
- React Native version: 0.63.2
- Plugin version: 1.87.1
- OS: iOS
- OS version: 14.0
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 44 (9 by maintainers)
I actually found a solution. I just had to run the
downloadBitcodescript as a pre build step./node_modules/react-native-webrtc/tools/downloadBitcode.sh.This issue is crazy. I am working on it at least 2 days and couldn’t found a proper solution. WebRTC.xcframework contains multiple architecture and when I delete arm64 compilation will success. Somehow when there is an arm64 architecture exist xcode can not compile it for simulator.
Bintray was sunset. You nee to update to 1.89.
@saghul Thank you for talking it out, sound like i just need to give the edits another crack. If i run into any issues ill make a separate issue/PR to track/discuss them if thats preferred to keeping this open.
FWIW, it you’re trying to do a release build, the pod install wont include the bitcode, you need to download that separately before you build by running
./node_modules/react-native-webrtc/tools/downloadBitcode.sh. That fixed the error for me.Are you using CocoaPods 1.10?
I have found a solution. Somehow Xcode can not find ios-x86_64-simulator when arm64 exists. I had to deleted ios-arm64 in the xcframework and build succeed. It is not an ideal solution but it worked for me. Folder path is as described below. Just delete ios-arm64 to use on simulator.