Chartboost plugin - game crashes when trying to serve an ad

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?

 

  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.

So far I didn’t see invalid license again. 

Now I call my chartboost init again like this:

if (event.name == "license") then if (event.status == "invalid" or event.status == "networkError") then \_myChartboostInit() end end

And I also call my chartboost init when application resume if Chartboost flag is not set as ready.

If you see anything inappropriate, please let me know. I have submitted it to App Store and have my fingers crossed. I like my last result with Chartboost, the revenue is higher than I expected, but I only tested a few days before I found the startup problem for some users. Hopefully this version will fix it. I will let you know.

Looks fine Joe.

Best of luck with the submission, let me know how you get on!

Cool, i will let it go and see what happens.

Thank you. i appreciate the fast response.

Mo

My app that uses the latest Chartboost plugin was published yesterday, and I have started to get user complaints that the app gets stuck again. 

Now I am considering to remove Chartboost from my app again.

I just find it weird how people have been using the plugin for months with no issues reported like this. And those users have hundreds of thousands of daily players. By this, i’m not trying to deny that it happens, just saying I wonder if there is a function call chain that is perhaps unique to the way most people are using perhaps, where it fails under a certain order of execution perhaps?

But if you can’t reproduce it locally, then that throws that theory out the window too i guess.

Is this only on Android or iOS also? Your waiting for the license callback to give you a valid response before calling any chartboost methods like you said before right?

The worst thing is that neither of us can reproduce it…

Thanks Joe

EDIT: Based on the crash report you provided Joe, i’m positive I have found the culprit. Please see my post here: http://forums.coronalabs.com/topic/50641-android-crash-report-in-chartboost-plugin-nullpointerexception/?p=262532

There is now safeguards in place that prevent that error from being possible to occur. Cheers.

New version pushed, available in about ~1.5 hours from the time of this edit.

All the reports about my app getting stuck are from iOS.

Earlier, I call init() right after the app starts and they said they couldn’t start the app. And for this new version, I call init() with a 2-second delay after the app starts, now the users said my app starts and gets stuck after a few seconds. I think it’s not just coincidence.

Of course now I only call any chartboost.* function after init returns valid license. I have a flag to be checked before every chartboost function(). If it’s not true, no chartboost function will be called.

Do you think “caching” could ever cause this? I mean I call cache function right after init() returns valid license in the callback. 

It’s very hard to reproduce. There are only a few users complaining about this comparing to my user base. I still see Chartboost revenue coming in everyday, I don’t want to remove Chartboost either. But my app is a reader app, not a small game, I can’t afford to lose reader’s loyalty to using my app. So I am very sensitive about user reports (and give them the reporting channel right in my app). I think they see this problem randomly too, not every time, or they can’t report this problem inside my app.

The Android crash only happened in rare occasion. Does it also happen in iOS? Would the problem above be associated with this crash?

That’s interesting information Joe.

I will take a look at the iOS version and see if the same race condition is possible there.

Don’t worry, we will get to the bottom of this. At least the android log gave us something to go on. I know this situation isn’t ideal and can appreciate your situation, as you know it’s just that much harder as we can’t reproduce it.

Thanks

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?