I’ve tried making a few test purchases of non-consumable items, and then removing+reinstalling the app. When I call store.restore to get the purchased items back, I am seeing this error:
06-09 15:19:47.939: E/AmazonCorona(18490): Unknown exception: ?:0: attempt to index field '?' (a nil value) 06-09 15:19:47.939: W/System.err(18490): com.naef.jnlua.LuaRuntimeException: ?:0: attempt to index field '?' (a nil value) 06-09 15:19:47.939: W/System.err(18490): at com.naef.jnlua.LuaState.lua\_pcall(Native Method) 06-09 15:19:47.939: W/System.err(18490): at com.naef.jnlua.LuaState.call(Unknown Source) 06-09 15:19:47.939: W/System.err(18490): at plugin.amazon.iap.LuaBridge.purchaseCallBack(LuaBridge.java:347) 06-09 15:19:47.939: W/System.err(18490): at plugin.amazon.iap.runnable.PurchaseUpdatesResponseRunnable.run(PurchaseUpdatesResponseRunnable.java:47) 06-09 15:19:47.939: W/System.err(18490): at plugin.amazon.iap.runnable.CoronaTaskDispatcher$3.executeUsing(CoronaTaskDispatcher.java:63) 06-09 15:19:47.939: W/System.err(18490): at com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:148) 06-09 15:19:47.939: W/System.err(18490): at com.ansca.corona.events.EventManager.sendEvents(EventManager.java:91) 06-09 15:19:47.939: W/System.err(18490): at com.ansca.corona.Controller.updateRuntimeState(Controller.java:285) 06-09 15:19:47.939: W/System.err(18490): at com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:417) 06-09 15:19:47.939: W/System.err(18490): at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1622) 06-09 15:19:47.939: W/System.err(18490): at com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1377)
What seems to be happening is that if I have say 4 non-consumable items, one of them will be restored, this error will appear and the remaining 3 will not be restored.
If I then kill the app and try again, I might get another one of the items restored first (as they don’t seem to be restored in any particular order), but it’s not a good user experience to have to keep killing the app to try and restore purchases.
Any idea what the error could be? It appears to originate in the plugin itself:
LuaBridge.purchaseCallBack(LuaBridge.java:347)