IOS项目中加入Google Admob SDK
錯(cuò)誤1.?Undefined symbols for architecture i386:
? "_OBJC_CLASS_$_ASIdentifierManager", referenced from:
? ? ? objc-class-ref in libGoogleAdMobAds.a(GADIdentifierUtilities.o)
? "_OBJC_CLASS_$_SKStoreProductViewController", referenced from:
? ? ? objc-class-ref in libGoogleAdMobAds.a(GADOpener.o)
? "_SKStoreProductParameterITunesItemIdentifier", referenced from:
? ? ? -[GADOpener openInAppStore:fallbackURLString:] 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)
除了《Google AdMob 廣告 iOS 初級(jí)指南》(https://developers.google.com/mobile-ads-sdk/docs/ios/fundamentals?hl=zh-cn,此文篇后的最佳實(shí)踐值得一看 )中所列出的幾個(gè)lib需加入外,還需要加入AdSupport、StoreKit兩個(gè)庫(kù)
?
錯(cuò)誤2.?[GADObjectPrivate changeState:]: unrecognized selector sent to instance 0x95c17d0'
需要在build settings里的other linker flags添加-ObjC標(biāo)志
?
錯(cuò)誤3. 無(wú)法正確顯示廣告,log打出“Cannot determine request type. Is your ad unit id correct?”
需改代碼:
self.adBanner.adUnitID = kSampleAdUnitID;
變量kSampleAdUnitID的定義指需改為你的Admob發(fā)布者ID。
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/edgarli/archive/2013/03/02/Admob.html
總結(jié)
以上是生活随笔為你收集整理的IOS项目中加入Google Admob SDK的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: SOAP 1.1 - 学习
- 下一篇: Android学习第三天--事件监听器