Chartboost plugin - game crashes when trying to serve an ad

I just updated my app to use the latest plugin (the asynchronous license “fix”) and it crashes every time it tries to serve an ad. What’s up with that?

Also, I now have to pull back a new game I made that was in review for 6 days because I figured out myself that the plugin wasn’t asynchronous and sometimes caused very long startup times. Completely unacceptable. This plugin really messed my release schedule up.

Edit:
Part of stack trace from crash report:

Thread 0 Crashed:

0   libsystem_platform.dylib       0x39325058 _platform_strcmp + 0

1   MyGame                     0x0022c98c Corona::chartboostLibrary::show(lua_State*) (ChartboostPlugin.mm:599)

2   MyGame                     0x000b0248 ___lldb_unnamed_function2553$$MyGame + 996

Does it happen every time or randomly?

I am about to use the new plugin and publish a new version of my app. 

It’s happening every time for me (app crashes). Before I updated to the latest version it worked fine (aside from the ridiculousness of synchronous license call). Definitely test thoroughly if you’re building using this latest version now.

Quick question if I may, how do you update to the “latest version”? I thought it was a plugin that was always up to date? I print out the version of the plugin and it says 1.3  Maybe I am just confuse on how plugins works. I too have an app waiting for review using the plugin.

Thanks.

Mo

Whenever you actually compile it uses whatever the current version is at that time. The version that’s crashing for me is one I compiled today. The newest version came out like a day ago from what I can see so I’m assuming this issue started occurring after that. I’m trying to figure out if anyone else is experiencing this.

I just tried to build my app again (so I think I am using the latest Chartboost)

Now my problem is that I don’t get callback after chartboost.init()

And if I call chartbosst.show(), I also see the crash:

0   libsystem\_platform.dylib       0x3ba93058 \_platform\_strcmp + 0 1   MyApp                         0x00264375 Corona::chartboostLibrary::show(lua\_State\*) (ChartboostPlugin.mm:599)

I was advised by Gremlin that don’t call any chartboost function if the license is not validated yet, so I added a flag in the chartboost callback:

if (event.name == "license" and event.status == "valid") then   \_isChartboostReady = true end

I check this flag before I call any chartboost.* function. This will avoid the crash.

Hence, I think you (dfoxinator) should have the same problem that you don’t get any callback from Chartboost plugin. Please take a look if you get any callback from Chartboost plugin after init() ?

Now the problem is why there is no callback from chartboost.init() after all?

PS. the weird thing is that I built again with another app, and that app is ok. It’s very confusing now. I have tried several times and confirmed all keys are correct (they were both using Chartboost plugin without problem at the first place), and what I am seeing now is that one app works and the other app has no callback after init() no matter what. There is a log “Invalid Parameter: URL argument was malformed URL” right after I call the init(), I am not sure if this is generated by my own app or Chartboost plugin if this might give some clue?

Hmm, good investigation. I didn’t have a chance to do any debugging because I had to re-submit my game right away with a different ad provider. However, what you found seems like the probable issue. I do not check to see if the licensing call succeeded in my other chartboost calls so it would make sense that if that call was broken nothing else would work.

That’s very weird that one of your apps works and the other doesn’t. Not sure what’s going on accept it’s clear that there’s a problem with the plugin :confused:

As stated in the documentation, you should always wait for a license validation response before making chartboost.* calls. 

That being said, ignoring that advise shouldn’t make it crash, so we will look into this straight away.

Thanks for the report.

PS: Is that happening on iOS & Android for you guys? Just one? 

Cheers

EDIT: Crashing issue: We have found the culprit (on the iOS version) and will have an update out asap.

PS: Please accept our deepest apologies for this issue.

It is happening for both iOS & Android. 

It’s not just about the crash… the problem is that I don’t receive callback after init(). I cannot use Chartboost for one of my apps after building with latest version of the plugin.

I understand that yeah. I am looking into that as we speak.

EDIT: Have found the problem relating to that. Will have it fixed in a few minutes.

Then a new build needs issuing to Corona’s servers. This process takes about 1.5~ hours to become available to you guys.

UPDATE: Both of the reported issues have been fixed

The fixed version of both of these issues is v1.4.1 - the fixed plugins have been pushed to Corona and should be available within ~1.5 hours from the time of this post.

You can check the plugin version via: chartboost.getPluginVersion()

Thanks

Thanks for the quick fix. The one that didn’t get callback works fine now.

However, during my testing, I restarted the app 5-6 times, there is one time the callback after init() says my license is invalid:

Aug 26 20:25:11 MyApp[7168] \<Warning\>: chartBoostListener -\> k/v = status invalid Aug 26 20:25:11 MyApp[7168] \<Warning\>: chartBoostListener -\> k/v = type check Aug 26 20:25:11 MyApp[7168] \<Warning\>: chartBoostListener -\> k/v = name license

Why is that? Not that stable for the license server?

Are you certain you had a active internet connection at the time?

We have tested our licensing server extensively and have never seen this happen, unless there was a blip in network connectivity at the client side.

Ok, if that is due to unstable network status for the client side, it’s always possible. 

It’s also a pity that if a client device starts up without a stable connection, chartboost will lose the opportunity to be initiated. Or do you recommend to init again during application suspend/resume?

I just see it again with “invalid” license callback.

I am actually pretty sure my device network is fine during the startup, because all images I am downloading (via network request) /showing at the same time are displayed without problem. 

P.S. my app is like an RSS-reader so it happens to download images from the network during startup too. Would it be possible that too many network requests are using at the same time?

I recommend calling the init function again if you get a response of networkError or invalid at whatever interval’s suits, calling it again if you don’t get a valid response is a nice failsafe. It would also be a good idea to do as you suggested, in case of network status changes between suspending the app and resuming of course also.

Edit: We will double check to ensure there is nothing wrong at our end however.

(1) Could you specify the event types & names I should use to call init() again? I know (name==“license” and status==“invalid”) for invalid, but how about the network error?

(2) What if init() is called twice accidentally? Would it cause any error (even crash) for the app? Can I safely assume that if I get callback error from init(), I can always call init() again without worrying causing any problem?

I tested your invalid license case and managed to reproduce it. I have made some server side changes and can no longer reproduce the invalid license state. Can you see if it’s better for you now also?

To answer your questions:

  1. See the docs here: http://gremlininteractive.com/corona-plugins-documentation/chartboost_plugin_corona_docs/

They list the events that are returned relating to the license callback.

  1. Yes, there should be no problem with that.

Thanks

I kind of remember sending my app for approval few days aog had the plugin version 1.3 Do I need to recall it?

Thanks.

Mo 

Completely up to you Mo. The changes in this new version are all licensing related, the build you made via v1.3 will still work as expected (that build didn’t have any of the issues listed in this thread, they were new issues relating to the licensing changes)

Thanks