iOS bundle crashes with admob-extension when app_open_ios is not used

Hi,

admob configuration suggests to add the following to our game.project file:

[admob]
app_id_ios = ca-app-pub-3940256099942544~1458002511
app_id_android = ca-app-pub-3940256099942544~3347511713
app_open_android = ca-app-pub-3940256099942544/9257395921
app_open_ios = ca-app-pub-3940256099942544/5575463023
ios_tracking_usage_description = Your data will be used to provide you a better and personalized ad experience.

But I do not want to use the app_open_ads. So I removed them from my game.project file. I only want to use interstitial and rewarded ads.

So my game.project section for admob looks like:

[admob]
app_id_ios = ca-app-pub-3940256099942544~1458002511
app_id_android = ca-app-pub-3940256099942544~3347511713
ios_tracking_usage_description = Your data will be used to provide you a better and personalized ad experience.

The android build works with the above. But for iOS the app crashes on startup with the following message in log:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString'

Fair enough, seeing the crash was just before the admob initialization callback, when I added the app_open_ios string back to game.project and rebuilt, the game launched and the test ad showed on app open.

I dont want to use app open ads. :confounded_face:

Also, the ATT dialogue does not show before first initialization of admob on ios. Without that the app is not accepted for review

Can you please verify that you are not calling admob.show_appopen() from your code?

Do you also have a line number or callstack in the log? I don’t really see how the crash can happen if you removed the game.project entries.

Yes, I can confirm that I am not using admob.show_appopen() anywhere in my code. Only admob.initialize() from the main menu when the game first starts up.

No line number was reported, but here is the full call stack:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** +[NSString stringWithUTF8String:]: NULL cString'
*** First throw call stack:
(0x181d8fc60 0x1995bbee4 0x18342a830 0x10440c5ac 0x1047f6474 0x104629d54 0x181d1dcf0 0x181d39dd8 0x181d6e20c 0x104831dac 0x181d2928c 0x181d2875c 0x1842ef434 0x18440c05c 0x184634434 0x1845c4174 0x1841d4cf4 0x1842908e4 0x1841d6a84 0x1842bb134 0x184710f38 0x18420472c 0x1842464cc 0x1841d2de8 0x192f01328 0x192f1815c 0x192efebdc 0x192f04a68 0x181a50094 0x1819f3150 0x192f002ac 0x192eff7c0 0x192f03960 0x181db0448 0x181dc0578 0x181d02734 0x181d07e08 0x181d1b174 0x1a2836988 0x18451da88 0x1842b6f78 0x10462bcf4 0x10462bb9c 0x1050884d0)

Ok, and the example project included with the extension also crashes when you remove the app_open_ios field from game.project?

deploying on ios is quite a task and not as simple as deploying on android, as you are aware.

Will need to create provisioning profile and certificates for the app to be able to deploy on device. (or thats my understanding at least).

Should I do that?

Ok, so I went ahead and created all the identifier and provisioning profile for the admob example project.

And if I remove the lines completely like so:

[admob]
app_id_ios = ca-app-pub-3940256099942544~1458002511
app_id_android = ca-app-pub-3940256099942544~3347511713
ios_tracking_usage_description = Your data will be used to provide you a better and personalized ad experience.

then the admob build also crashes.

But if I leave them empty and not completely remove them, then the app does not crash:

[admob]
app_id_ios = ca-app-pub-3940256099942544~1458002511
app_id_android = ca-app-pub-3940256099942544~3347511713
app_open_android = 
app_open_ios = 
ios_tracking_usage_description = Your data will be used to provide you a better and personalized ad experience.

Oooh, ok, that’s a bug, Can you please create a bug report on GitHub? I’ll try to fix it later this week.

1 Like