iPhone SDK WebRTC集成错误

当我的iOS项目安装WebRTC时 ,我收到以下错误:

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) 

我该如何解决?

这意味着你正在试图在模拟器上运行这个项目(i386是Mac的体系结构),但是这个项目只能运行在iPhone,iPad和iPod touch设备(armv7架构)上。

我认为它不能用于模拟器的原因是它不能被testing。 无法在模拟器上访问摄像头和麦克风。

你有没有尝试在iPhone 4及更高版本上运行它?

如果您使用Podfile方法(如https://tech.appear.in/2015/05/25/Getting-started-with-WebRTC-on-iOS/中所述 )在您的Xcode工作区中安装WebRTC依赖项,则解决方法是将项目的构build设置中的“Other Linker Flags”设置为$(inheritance)。

然后它将是来自工作区的inheritance链接选项。