While installing WebRTC to my iOS project I am getting the following error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_RTCICECandidate", referenced from:
objc-class-ref in APPRTCAppDelegate.o
"_OBJC_CLASS_$_RTCICEServer", referenced from:
objc-class-ref in APPRTCAppClient.o
"_OBJC_CLASS_$_RTCMediaConstraints", referenced from:
objc-class-ref in APPRTCAppDelegate.o
"_OBJC_CLASS_$_RTCPair", referenced from:
objc-class-ref in APPRTCAppDelegate.o
"_OBJC_CLASS_$_RTCPeerConnectionFactory", referenced from:
objc-class-ref in APPRTCAppDelegate.o
"_OBJC_CLASS_$_RTCSessionDescription", referenced from:
objc-class-ref in APPRTCAppDelegate.o
"_OBJC_CLASS_$_RTCVideoCapturer", referenced from:
objc-class-ref in APPRTCAppDelegate.o
"_OBJC_CLASS_$_RTCVideoRenderer", referenced from:
objc-class-ref in VideoView.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How do I fix this?
If you used the Podfile approach (as described in https://tech.appear.in/2015/05/25/Getting-started-with-WebRTC-on-iOS/ ) to install the WebRTC dependencies in your Xcode workspace, then the solution is to set the "Other Linker Flags" in the build setting of your project to $(inherited).
Then it will be an inherited link options from the workspace.
This means that you're trying to run the project on the simulator (i386 is the architecture for Mac), but the project is destinated to run only on iPhone, iPad and iPod touch devices (armv7 architecture).
I think the reason why it's not available for the simulator is that it cannot be tested on it. It's not possible to access the camera and the microphone on the simulator.
Did you try to run it on iPhone 4 and higher?