admob ios7 error Audio framework

情到浓时终转凉″ 提交于 2019-12-06 18:36:36

问题


I am integrating admob SDK (the current) in my last application IOS7-Xcode5 and i have a new error (same on new project), i guess i missed something, but i restarted the process many times and the error is still here:

Undefined symbols for architecture armv7:
  "_OBJC_CLASS_$_AVAudioSession", referenced from:
  objc-class-ref in libGoogleAdMobAds.a(GADDevice.o)
  "_AVAudioSessionPortHeadphones", referenced from:
      -[GADDevice audioRouteUsingAVAudioSession] in libGoogleAdMobAds.a(GADDevice.o)
  "_AVAudioSessionPortBuiltInSpeaker", referenced from:
      -[GADDevice audioRouteUsingAVAudioSession] in libGoogleAdMobAds.a(GADDevice.o)

I found how to resolve these errors in adding AudioUnit.framework but a new error appears framework not found AudioUnit... As my best friend Google tell me via stackoverflow, "don't use AudioUnit.framework, it's empty! Now use CoreAudio.framework." But my first error came back...

If someone has the same problem and mainly a solution, i will be grateful :)

PS: i tried -all_load and -ObjC, i linked AudioToolbox, i usually work with frameworks but also with careless mistakes ;) :/


回答1:


hey add AVFoundation framework, because these classes are included in this framework.




回答2:


The Google Mobile Ads SDK library references the following iOS development frameworks which may not already be part of your project:

  • AdSupport
  • AudioToolbox
  • AVFoundation
  • CoreGraphics
  • CoreMedia
  • CoreTelephony
  • EventKit
  • EventKitUI
  • MessageUI
  • StoreKit
  • SystemConfiguration

Make sure all of them are added to your target > Build Phases > Link Binary With Libraries.

More info




回答3:


I got it working. Below are the things I tried,

  • Changed GoogleAdMobAdsSdkiOS-6.6.1 to GoogleAdMobAdsSdkiOS-6.7.0
  • Added AVFoundation.framework.
  • Added CoreAudio.framework.


来源:https://stackoverflow.com/questions/20045240/admob-ios7-error-audio-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!