I'm using AdMob 6.2.1 in my app which runs under iOS 6 only. I've followed google instructions and everything is working well when running on the simulator and on my iPhone 5.

But, when submitting to Apple the app, i get it refused and the crash log indicates the following:

Last Exception Backtrace:
0   CoreFoundation                  0x3abcb3e2 __exceptionPreprocess + 158
1   libobjc.A.dylib                 0x392d695e objc_exception_throw + 26
2   CoreFoundation                  0x3abcef2c -[NSObject(NSObject) doesNotRecognizeSelector:] + 180
3   CoreFoundation                  0x3abcd648 ___forwarding___ + 388
4   CoreFoundation                  0x3ab25204 _CF_forwarding_prep_0 + 20
5   Dus                             0x000d39f4 -[GADObjectPrivate loadPrivateRequest:autoRefresh:] (GADObjectPrivate.m:402)
6   Dus                             0x000d5454 -[GADObjectPrivate loadRequest:] (GADObjectPrivate.m:827)
7   Dus                             0x000d2f20 -[GADBannerView loadRequest:] (GADBannerView.m:271)
8   Dus                             0x000b57cc -[DMViewController viewDidLoad] (DMViewController.m:131)

I don't understand why it is working for me and crashing with Apple staff.

I had added -ObjC (both to Debug and Release) to Other Linker Flags in Build Settings.

Here is the block code where the crash occurs:

bannerView = [[GADBannerView alloc] initWithAdSize:kGADAdSizeBanner origin:origin];

bannerView.adUnitID = @"MYBANNERID";
[bannerView setRootViewController:self];
[bannerView setDelegate:self];
bannerView.center = CGPointMake(self.view.center.x, bannerView.center.y);

GADRequest *request = [GADRequest request];

[bannerView loadRequest:request]; //CRASHES HERE
[self.view addSubview:bannerView];

Thank you all for your help.

share|improve this question
Interesting that issue usually comes because of a lack of the ObjC flag. What is your base SDK set to? Also did Apple give you any other info as to what devices/iOS version they saw that crash on? – RajPara Jan 14 at 23:07
My base SDK is set to "Latest iOS (iOS 6.0)". Apple said that they tried the app onto iPhone and iPad (my app is only targeting iPhones) with Wifi and carrier network too, but keeps crashing... – Jameltheone Jan 15 at 10:06

1 Answer

Place request into ViewDidAppear method.

share|improve this answer
thank you, but what's differ with ViewDidLoad? In google doc available here: [link]developers.google.com/mobile-ads-sdk/docs/admob/fundamentals they request in ViewDidLoad – Jameltheone Jan 12 at 11:46
I don't know, I haven't seen source code. – Flink Jan 12 at 11:59

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.