ios 项目添加AdMob 错误记录

依照官方教程添加文件及其 frameWork后 发现运行报错 错误如下

Undefined symbols for architecture i386:

  "_OBJC_CLASS_$_ASIdentifierManager", referenced from:

      objc-class-ref in libGoogleAdMobAds.a(GADIdentifierUtilities.o)

ld: symbol(s) not found for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

Undefined symbols for architecture i386:

"_OBJC_CLASS_$_SKStoreProductViewController", referenced from:

  objc-class-ref in RevMobAds(RevMobStoreController.o)

"_SKStoreProductParameterITunesItemIdentifier", referenced from:

  -[RevMobStoreController openStoreWithITunesItemId:] in RevMobAds(RevMobStoreController.o)

ld: symbol(s) not found for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

最终通过添加 frameWork搞定  添加了 StoreKit.framework    AdSupport.framework  CoreData.framework .

运行继续报错

ld: duplicate symbol _OBJC_CLASS_$_AppDelegate in /Users/AbhilashReddy/Library/Developer/Xcode/DerivedData/santabantaa-bykvybsbvqshqshfqxdlsxiqhehc/Build/Intermediates/santabantaa.build/Debug-iphonesimulator/santabantaa.build/Objects-normal/i386/AppDelegate-C7A14BE43C5E8C81.o and /Users/AbhilashReddy/Library/Developer/Xcode/DerivedData/santabantaa-bykvybsbvqshqshfqxdlsxiqhehc/Build/Intermediates/santabantaa.build/Debug-iphonesimulator/santabantaa.build/Objects-normal/i386/AppDelegate-A37C3709371E4892.o for architecture i386

clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

原来很是2的把demo也给弄进来了,删除demo的那个文件夹Add-ons 就好了

再次报错 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GADObjectPrivate changeState:]: unrecognized selector sent to instance 0x95c17d0'

解决方案 add -ObjC to the Other Linker Flags of your application target's build setting。

加了个广告 他妹的把所有能碰到的问题都碰到了 真是技术不纯熟害死人啊。~~~

PS:要弄个全屏的Admob 看了下SDK 似乎没有 就自己动手写  

[[GADBannerView alloc] initWithFrame:self.view.bounds];  结果报错 errors = "Ad size will not fit on screen"  

但是改为 [[GADBannerView alloc] initWithFrame:CGRectMake(0,0,320,480)];  就可以。 但是同时写了下半屏的CGRect,发现半屏的 frame 显示的不完全,左右被压缩得很厉害,造成了只显示了一个icon和一个按钮。不知道怎么解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值