InMobi ad issues when using director

In the link below, there is just a simple project with director 1.3 and two scenes, both of which show ads. Build the project for the simulator or device, and quickly tap between the two scenes, before an ad has loaded. It will crash. If you change showAds on main.lua:4 to false (to not show ads) you can tap as quickly as you want, and it won’t crash in the simulator (or device). In Bubble Ball we are having this issue. Carlos has said " this is result of director class timing …"
It’s not anything with director 1.3, I’ve tried it with every single version of director.
Sample Project: http://cl.ly/0U0D112c152C0z1X0A3O [import]uid: 8782 topic_id: 13404 reply_id: 313404[/import]

Hi Robert,

The thing here is about autonomous transactions (threads). When you start a timer, transition or a network call, the program will not wait for the result. When you create an ad and quickly change the scene, it will callback after the process and then will crash. My advice is to create some “protection” to be sure that the scene will only change when it’s not waiting any answer.

This is one of the reasons that I created an invisible square to prevent touches while transitioning between scenes on Director 1.3.

Ricardo Rauber [import]uid: 8556 topic_id: 13404 reply_id: 49234[/import]

How would I do that? The ads don’t provide any form of callback or anything. [import]uid: 8782 topic_id: 13404 reply_id: 49241[/import]

This is listed in a note on the Ansca api reference for ads.show():

Note1: Currently there is a problem that will cause the app to crash if you call ads.hide() before the ad has finished loading (from ads.show). 8/2/2011

I don’t use Director for transitions and experience a crash if I transition from a scene with inMobi enabled but ads not yet loaded (as happens if changing rapidly between scenes). So I don’t believe this is specific to Director.
[import]uid: 9422 topic_id: 13404 reply_id: 49273[/import]

XenonBL is correct in that this is a known issue that is unrelated to director. [import]uid: 52491 topic_id: 13404 reply_id: 49292[/import]

So if I don’t want an ad to show up on say a level, there’s no way to do that without potentially crashing the app? That kinda stinks… The ad api should at least give you a callback when an ad has finished loading. [import]uid: 8782 topic_id: 13404 reply_id: 49537[/import]

It really stinks, I know - but we’re aware of it so it will be addressed. [import]uid: 52491 topic_id: 13404 reply_id: 49734[/import]

@peach, is there a forum post/thread that specifically discusses the issue about a crash associated with inMobi described above?

With the game I’m working on, I get physics objects freeze (and crashes the game) when inMobi banner ads are enabled – i.e., I believe the crash happens when inMobi is switching one banner ad to another just when my screen object is in transition (size changing or moving location) or maybe when my screen objects hit a collision sensor. (Transition happens almost immediately after objects hit the sensor) This has nothing to do with changing scene.

BTW, I love director class. Took me a few days to figure out the overall concept/structure and how it works – but once I got it, it’s so straight forward that it’s almost unbelievable how I found it confusing the first time I tried using it.

Thank you ricardo for making the class available for everyone! It’s awesome. [import]uid: 67217 topic_id: 13404 reply_id: 52033[/import]

Hey ask,

I agree - director (and Ricardo) are awesome :smiley:

Here’s two forum topics mentioning it, the second one was just updated;
http://developer.anscamobile.com/forum/2011/08/03/inmobi-sample-crash
http://developer.anscamobile.com/forum/2011/08/03/eta-inmobi-crash-bug-fix

Peach :slight_smile: [import]uid: 52491 topic_id: 13404 reply_id: 52077[/import]

Thank you so much for the links! I really appreciate it! [import]uid: 67217 topic_id: 13404 reply_id: 52119[/import]