19 August 2013
Comments: 0

Unity: Amazon Kindle HD crash on resume

I’ve decided to try a new approach for this blog: Instead of posting monolithic blocks of text while working on my apps, I’ll be splitting them into individual posts in a new section devoted to Unity coding.

I seriously started work on the Transmutation Amazon release this morning. I know that the general Android version runs OK, but I also knew there would be some work involved in testing in-app billing, and following up on why AdMob ads were not appearing on my shiny new Fire HD.

While Unibill performed like a champ today, I noticed that the app was seriously flaky on the HD. Quitting or pausing the app would write a few error lines into the log and leave the it in a “crashed” state. Attempting to restart or resume would just display a black screen and eventually lock the device up, forcing a reset.

Looking at the device log, events such as OnApplicationPause would not fire and errors similar to the following would appear:

The Android manifest has been filling up with entries, so I decided to do some spring cleaning.┬áTo get a clean manifest, I renamed the one I was using, rebuilt the app, then compared the original to the “stock” manifest.

I found only one difference, a VideoPlayer activity from the pro version of Unity had found it’s way into my app’s manifest.

After I had removed and re-tested the app, it seemed to be more stable.

Unfortunately, this didn’t fix the issue I was having with AdMob ads not showing 100% of the time. I’d created a new Publisher ID just for Amazon Ads, and AdMob’s request counter showed that the only requests that had been made, were the ones that had worked.

Most of the time, Transmutation wasn’t receiving an ad request at all.

This matched the device log which showed that the OnAdReceived and OnAdFailed events weren’t firing when ads weren’t showing. Running the same exact code on my Transformer Prime resulted in working events and ads, every time.

As far as I can tell, this is probably a fault in Prime31′s implementation of the AdMob plugin. To be honest, I wasn’t able to find anything that specifically stated that Prime31 would support AdMob on Amazon.

I’ve reported it to Prime31 with as much information as possible to see what they say.

If they respond with “not supported on Amazon”, I’ll have to ask for a refund because I’ll just have to write my own AdMob implementation that works.