AdMob的崩溃与[GADObjectPrivate改变状态:]:无法识别选择 [英] AdMob crashes with [GADObjectPrivate changeState:]: unrecognized selector
问题描述
我已经安装了AdMob的SDK 6.2.0(X code ++ 4.5(4G182)和我正在测试的iPhone 4S和仿真器)。我跟着教程,只是想获得AdMob的一次展示的一面旗帜。但它崩溃的最后一行:
I have installed the AdMob SDK 6.2.0 (Xcode 4.5 (4G182) and I am testing on an iPhone 4S and the simulator). I followed the tutorial and just want to get AdMob showing a banner once. But it crashes on the last line:
self.bannerView = [[GADBannerView alloc]
initWithFrame:CGRectMake(0.0,
self.view.frame.size.height -
GAD_SIZE_320x50.height,
GAD_SIZE_320x50.width,
GAD_SIZE_320x50.height)];
self.bannerView.delegate = self;
self.bannerView.adUnitID = @"xREMOVEDBYMEx";
self.bannerView.rootViewController = self;
[self.view addSubview:self.bannerView];
GADRequest * request = [GADRequest request];
request.testing = YES;
[self.bannerView loadRequest:request];
崩溃是
2012-09-28 09:03:58.268 NewProject [1467:C07] - [GADObjectPrivate改变状态:]:无法识别的选择发送到实例0x95c17d0 2012-09-28 09:03:58.276 NewProject [1467:C07]的 * 的终止应用程序由于未捕获的异常NSInvalidArgumentException,原因是:' - [GADObjectPrivate改变状态:]:无法识别的选择发送到实例0x95c17d0
2012-09-28 09:03:58.268 NewProject[1467:c07] -[GADObjectPrivate changeState:]: unrecognized selector sent to instance 0x95c17d0 2012-09-28 09:03:58.276 NewProject[1467:c07] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[GADObjectPrivate changeState:]: unrecognized selector sent to instance 0x95c17d0'
这看起来像在图书馆给我的错误,但我认为是不太可能。有什么想法?
This looks like a bug in the library to me but I think thats very unlikely. Any thoughts?
编辑:在本例中的项目完全相同的code ++工程。有什么我可以做的不对我的项目文件,会导致该错误?
The exact same code works in the example projects. Is there something I can do wrong with my project file that would result in that error?
推荐答案
您需要添加 -ObjC
到其它链接器标记的你应用目标的构建设置:
You need to add -ObjC
to the Other Linker Flags of your application target's build setting:
- 单击在X code中的蓝色的顶级项目图标
- 选择您的目标,去的构建设置的
- 在其它链接器标记的补充
-ObjC
为的发布和调试的
- Click the blue top-level project icon in XCode
- Choose your target and go to Build Settings
- Under Other Linker Flags add
-ObjC
for both Release and Debug
来源:<一href="https://developers.google.com/mobile-ads-sdk/docs/admob/mediation#ios-linker">https://developers.google.com/mobile-ads-sdk/docs/admob/mediation#ios-linker
另外,一定做一个干净和重建
Also be sure to do a clean and rebuild
这篇关于AdMob的崩溃与[GADObjectPrivate改变状态:]:无法识别选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!