Crashing on 1st Gen Kindle Fire

Another suggestion is to put the restore function on a button. This is how Apple insists that you handle this. If store.restore() is the culprit and it could be a problem is there is nothing to restore, you could at least get people into the game and playing it. You only need to restore if someone deletes and reinstalls the app later.  Since this isn’t a common thing, doing a restore at the beginning seems a bit

brute force.

In the mean time I’ll loop in the engineer who did the plugin and see if he has any thoughts. We may need a bug report at some point, but it will be tough since it’s a live server issue.

Rob

Also can you put prints in and around your code to fetch the prices and items and make sure you’re not crashing there?

That’s how I’ve had it implemented for years (a button for restore), but when migrating to IAP v2 on Amazon it said they required the app to automatically check for purchases that may have been bought previously.  So I added this snippet of code, which worked fine in simulator and on device testing environment.  But seems to break horribly in production.

And of course now I cannot find this reference in any of Amazon’s documentation about IAP v2… sigh.  I’ll remove this snippet, test, and resubmit.  Will keep you updated!

I showed the error to the engineer who wrote the plugin and he was able to find the cause. New plugin binaries have been pushed to the server. It may take a few minutes for them to sync up. But try building now and see if the error is eliminated.

Rob

Would I need to download a new daily build?  Also do you know more in detail what is broken?  I already have a new binary about to go live on Amazon that simply removed the restore on load code.

Hey Rob, new version 3.3 is out.  Would love for you to download and test when you have a moment.

Still crashed:

I/Corona  ( 9217): DEBUG: enter scene 1
I/Corona  ( 9217): DEBUG: enter scene 2
I/Corona  ( 9217): DEBUG: enter scene 3
I/Corona  ( 9217): DEBUG: enter scene 4
W/dalvikvm( 9217): threadid=8: thread exiting with uncaught exception (group=0x400155a8)
E/AndroidRuntime( 9217): FATAL EXCEPTION: GLThread 9
E/AndroidRuntime( 9217): java.lang.NullPointerException
E/AndroidRuntime( 9217):     at java.util.Hashtable.put(Hashtable.java:369)
E/AndroidRuntime( 9217):     at plugin.amazon.iap.LuaLoader$1.executeUsing(LuaLoader.java:241)
E/AndroidRuntime( 9217):     at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:148)
E/AndroidRuntime( 9217):     at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:91)
E/AndroidRuntime( 9217):     at com.ansca.corona.Controller.updateRuntimeState(Controller.java:300)
E/AndroidRuntime( 9217):     at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421)
E/AndroidRuntime( 9217):     at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623)
E/AndroidRuntime( 9217):     at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)
W/ActivityManager( 1404):   Force finishing activity com.kevinbradford.games.barnyardgamesfree/com.ansca.corona.CoronaActivity

I’ll ping the engineer again.

Rob

This is not with the new fix he implemented.  This was a build done before.  Can I just rebuild with my current public release, or do I need to download a daily build?

You know what’s interesting, is I’m seeing 0 crash reports for version 3.3 on Amazon’s dashboard.  Usually I’d have 20-30 by now today.  You sure you downloaded the new version 3.3 for testing?

You shouldn’t need to change your build. Plugins update independently. You may have not gotten the new one. The error I got was identical to what he fixed.

Rob

Okay, v3.4 is now live and it includes the plugin fix.  Please test it out when you get a chance.  Thanks Rob for all the help!

It did not crash!

Awesome!  Whatever your engineer did fixed the problem.  Thanks for all the help Rob, really appreciate it!

Do you have a URL for the app?

Rob

http://www.amazon.com/Barnyard-Games-for-Kids-Free/dp/B0076ANQQC

Thanks Rob!

I was hoping there would be more in the console log, unfortunately there isn’t. However, its coming from the Amazon IAP plugin. Now I can’t tell if you’re using the new Amazon plugin or the old one (II don’t think you should be able to get to the old one an longer). But you’re getting a null pointer.

Perhaps it would be helpful for you to share your build.settings and  your IAP setup code. It’s getting into displaying the main menu and getting some audio playing before it crashes.

Perhaps it’s trying to handle a transaction as the result of calling store.restore(). Adding some prints along your IAP calls might help narrow down when it’s occurring.

Rob

Thanks Rob, I’m using the new IAP code.  In fact this update was specifically to start using the new plugin.  What’s odd is it works fine in every single Kindle/Android device except for the first gen Fire.  Any clue why would that handle IAP’s differently?

I call store.restore as the very last thing on enterScene, so everything should already be setup at that point.

The only thing I can suggest is to put in some print statements. Perhaps the KF1 is giving a different result to a call back function.

Hey Rob, I’ve added a few catches for null pointers to some of my IAP code and also added a bunch of print debug statements.  Any chance I could send you an APK somehow that you could test on your first-gen Fire?  I’d really appreciate it!

Sure. You can put it on dropbox and give me (or anyone else in the forums with a First 1 KF) a chance to look at it.

Rob