Crash when presenting interstitials

232 views
Skip to first unread message

Ivano Bilenchi

unread,
Aug 17, 2016, 9:42:15 AM8/17/16
to Google Mobile Ads SDK Developers
Hello,

I've been receiving a number of identical crash logs from the users of my app, which seem to be caused by the Google SDK. As can be seen in the crash log, the crash happens after I call "[GADInterstitial presentFromRootViewController:]", which fails down the line at "[UIColor encodeWithCoder:]". The message of the uncaught exception is visible in the syslog: "Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Only RGBA or White color spaces are supported in this situation.'"

I was wondering if anyone else is experiencing this issue and if there is a known fix, or either way if this is an issue that's being worked on.

I'll note that this crash happens with the latest version of the Google Ads SDK (7.9.1), while it doesn't happen with version 7.5.2, which is the version I was using right before updating. I also cannot reproduce it, so I'm guessing it only happens with specific kinds of ads (?).

Any help is greatly appreciated.
iOS6_iCleaner-2016-08-14-003036.symbolicated.ips
iOS6_iCleaner-2016-08-14-003036.syslog

Ivano Bilenchi

unread,
Aug 29, 2016, 10:28:19 AM8/29/16
to Google Mobile Ads SDK Developers
Hello again. Any follow-up on this?

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Aug 29, 2016, 10:54:56 AM8/29/16
to Google Mobile Ads SDK Developers
Hi Ivano,

Can you send us a sample app of your implementation? Even a code snippet on how you are trying to load these Interstitial Ads would be helpful. The crash seems to be happening on the latest iOS versions but looking at your stack trace, I notice these two symbols - 

-[ICAdController showInterstitialWithRootViewController:autodismissDelay:completionHandler:] + 0x21c
-[ICCleanupViewController progressTick] + 0x1d6 

Is there something specific that you are trying to do when you present these Interstitial Ad Views? Can you share the link to your live app and let us know where this crash is occurring as well?

Thanks,
Arjun Busani
Mobile Ads SDK Team

Ivano Bilenchi

unread,
Aug 30, 2016, 11:25:02 AM8/30/16
to Google Mobile Ads SDK Developers
Hello,

I attached my ad-related classes. As you can see, they're just wrappers around GADInterstitial that I'm using to have a block-based completion API (rather than using delegates) and to let me auto-dismiss the interstitial after a couple of minutes (my app shows the interstitial ad, but after a while it needs to continue running even if the user is away from his device).

In order to show the interstitial, I just do the following:

// "self" is a standard UIViewController that's being presented modally

// Early on
ICAdController *adController = [[ICAdController alloc] init];
[adController loadInterstitial];
self.adController = adController;

// When it's time to show the interstitial to the user
[self.adController showInterstitialWithRootViewController:self autoDismissDelay:120.0 completionHandler:^{
    // My completion handler
}];

Unfortunately, as I said in my original post, I cannot reproduce this crash on any of my devices, but the stack trace clearly shows it's crashing while attempting to present the interstitial ad (e.g. after [GADInterstitial presentFromRootViewController:] has been called). Everything was also working perfectly until I updated to version 7.9.1 of the Ads SDK. I saw you guys released a new version of the SDK, though I don't see this issue referenced anywhere in the release notes, so I'm guessing it may still happen with the newest version.

Let me know if you need any further details, and thank you for replying!
ICAdInterstitial.h
ICAdController.h
ICAdInterstitial.m
ICAdController.m

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Aug 30, 2016, 11:47:24 AM8/30/16
to Google Mobile Ads SDK Developers
Hi Ivano,

You are not supposed to auto close the Interstitials and this might just be the cause of the crash. Remove this bit and try again. The SDK has never given this API to auto close the Interstitial for a reason. It is not fair for the advertisers to close without an user interaction. 

However, if you still want to implement this, then we have a method via DFP using the admob.opener.close() method. But these are for ads that you are directly serving only. You can learn more about this here.

Thanks,
Arjun Busani
Mobile Ads SDK Team

Ivano Bilenchi

unread,
Aug 31, 2016, 10:15:34 AM8/31/16
to Google Mobile Ads SDK Developers
Hello,

thank you for your reply. I understand the API to dismiss the interstitials is not there for a reason (even though I'm simply using public Apple APIs and cannot find anything in your TOS or ad guidance against this :/), and I'll update my app accordingly. However, I'm 100% certain this won't fix the crash I'm experiencing...

The crash happens when I present the interstitial, not when I (or the user) dismiss it. According to users, the interstitial is not even shown on screen, so it crashes as soon as I attempt to present it. This can also be clearly seen in the stack trace, since again the crash is triggered within the [GADInterstitial presentFromRootViewController:] method, that I do not control.

Unfortunately I had to revert to version 7.5.2 of the Google SDK, and I haven't received any other complaint since.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 1, 2016, 12:15:40 PM9/1/16
to Google Mobile Ads SDK Developers
Hi Ivano,

You do realize that you have this wrapper View Controller to present the Interstitial immediately? It's obvious that in a case where the View Controller is not loaded but the Interstitial is asked to present, it would crash. You need to make sure that you are presenting with a valid View Controller and your code is not checking for this.

Thanks
Arjun Busani
Mobile Ads SDK Team

Ivano Bilenchi

unread,
Sep 2, 2016, 9:57:21 AM9/2/16
to Google Mobile Ads SDK Developers
Hello,

no, that is not the case. ICAdController is not a UIViewController, it's just a "classical" MVC controller (as you can see in ICAdController.h, it inherits from NSObject). As I said earlier, the ad is presented on a valid "Apple" view controller (that inherits from UIViewController) via this code:

// "self" is a standard UIViewController that's being presented modally

// Early on
ICAdController *adController = [[ICAdController alloc] init];
[adController loadInterstitial];
self.adController = adController;

// When it's time to show the interstitial to the user
[self.adController showInterstitialWithRootViewController:self autoDismissDelay:120.0 completionHandler:^{
    // My completion handler
}];

ICAdController then checks if the interstitial is ready and has not been used, in which case it shows the interstitial on top of the current UIViewController. I'll note that "[ICAdController showInterstitialWithRootViewController:autoDismissDelay:completionHandler:]" is called when the root view controller for the interstitial ("self" in the above code snippet) is loaded and visible on screen.

Another thing that should be noted is that if that was the case, then my code should also crash with version 7.5.2 of the SDK, but this does not happen. Don't you think this may actually be a bug introduced in one of the latest releases of the Google SDK?

(I hope I don't sound demanding. I would just love to see this issue fixed, and am willing to cooperate as best I can).

Thank you for your patience.

Veer Arjun Busani(Mobile Ads SDK Team)

unread,
Sep 2, 2016, 3:41:40 PM9/2/16
to Google Mobile Ads SDK Developers
Hi Ivano,

Call the Interstitial directly from the ViewController that you are presenting from and not from an NSObject. Make this change and let us know if the crashes still occur. Also, here is an excerpt from our guidelines:

  • Only directly-booked interstitials can be automatically closed; interstitials served via dynamic allocation (i.e., Ad Exchange, AdSense or AdMob) can only be dismissed by the user.
Thanks,
Arjun Busani
Mobile Ads SDK Team
Reply all
Reply to author
Forward
0 new messages