问题
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