I am trying to make a WebRTC.xcframework build for on an iOS device.
Here is what I am running to build it.
gn gen out/ios_arm64device --args='target_os="ios" target_cpu="arm64" ios_code_signing_identity="********" ios_code_signing_identity_description=""'
ninja -C out/ios_arm64device sdk:framework_objc
xcodebuild -create-xcframework -framework out/is_arm64device/WebRTC.framework -output out/arm64/WebRTC.xcframework
However after I add the WebRTC.xcframework to my project I get the following error when I try to run it:
Undefined symbols for architecture arm64:
"_OBJC_CLASS_$_RTCPeerConnectionFactory", referenced from:
objc-class-ref in RTIWebRTCClient.o
"_OBJC_CLASS_$_RTCDefaultVideoDecoderFactory", referenced from:
objc-class-ref in RTIWebRTCClient.o
"_OBJC_CLASS_$_RTCDefaultVideoEncoderFactory", referenced from:
objc-class-ref in RTIWebRTCClient.o
"_RTCInitializeSSL", referenced from:
-[RTIWebRTCClient configure] in RTIWebRTCClient.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Are you able to tell what I am missing?
Add the argument
rtc_enable_symbol_export=true
in yourgn gen
and generate your framework again, it should work.