尝试使用AdMob运行应用时出现奇怪的错误

时间:2012-04-30 19:31:46

标签: iphone objective-c ios xcode

    Undefined symbols for architecture i386:
  "_AudioServicesPlaySystemSound", referenced from:
      -[GADWebViewDelegate webView:shouldStartLoadWithRequest:navigationType:] in libGoogleAdMobAds.a(GADWebViewDelegate.o)
  "_OBJC_CLASS_$_MFMailComposeViewController", referenced from:
      objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
  "_OBJC_CLASS_$_MFMessageComposeViewController", referenced from:
      objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
ld: symbol(s) not found for architecture i386
 clang: error: linker command failed with exit code 1 (use -v to see invocation)

这意味着什么?为了解决这个问题,我需要做些什么?

非常感谢。

3 个答案:

答案 0 :(得分:2)

仅供参考 - 我必须添加AudioToolbox框架才能进行编译。

答案 1 :(得分:2)

解决方案是添加AVAudioPlayer和MessageUI框架。就是这样。

答案 2 :(得分:1)

从哪里获得你正在使用的库,它只编译为在设备上使用..(架构armv7),在那里你试图在模拟器(架构i386)上测试它因此错误。因此,如果您想在模拟器上测试它,请获取为i386编译的库版本。

您还可以使用lipo命令组合这两个库,并在任何架构上使用它。

希望这会有所帮助.. :)