store.purchase crashes with NullPointerException on some Android devices

Hi, 

We have a user that cannot complete a purchase. Whenever the code reaches the line:

store.purchase(productId)

the app crashes with the following exception:

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Object android.os.Bundle.get(java.lang.String)' on a null object reference Java Stack Trace: plugin.google.iap.v3.util.IabHelper.getResponseCodeFromBundle(IabHelper.java:809) plugin.google.iap.v3.util.IabHelper.launchPurchaseFlow(IabHelper.java:413) plugin.google.iap.v3.util.IabHelper.launchPurchaseFlow(IabHelper.java:359) plugin.google.iap.v3.util.IabHelper.launchPurchaseFlow(IabHelper.java:354) plugin.google.iap.v3.LuaLoader.purchase(LuaLoader.java:358) plugin.google.iap.v3.LuaLoader.access$1400(LuaLoader.java:37) plugin.google.iap.v3.LuaLoader$PurchaseWrapper.invoke(LuaLoader.java:469) com.ansca.corona.JavaToNativeShim.nativeTouchEvent(Native Method) com.ansca.corona.JavaToNativeShim.touchEvent(JavaToNativeShim.java:416) com.ansca.corona.input.RaiseTouchEventTask.executeUsing(RaiseTouchEventTask.java:39) com.ansca.corona.CoronaRuntimeTaskDispatcher$TaskEvent.Send(CoronaRuntimeTaskDispatcher.java:170) com.ansca.corona.events.EventManager.sendEvents(EventManager.java:91) com.ansca.corona.Controller.updateRuntimeState(Controller.java:305) com.ansca.corona.graphics.opengl.CoronaGLSurfaceView$CoronaRenderer.onDrawFrame(CoronaGLSurfaceView.java:421) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1623) com.ansca.corona.graphics.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1378)

The user is using a Cubot Note S with the Android OS version 5.1.

The app was compiled with the simulator version 2016.2907. 

Any help will be greatly appreciated.

Thanks!

What is the value of productId?

Since the platform is Android, the value of productId is a string representing the produce id in the Google Play store (it works for other Android users)

Sorry, I should have been more clear. I was hoping you would drop a print statement in and verify the value of productId when you get the crash. I was curious what the exact value was at the time of the crash.

Rob

I don’t understand why the actual product id’s we’re using are relevant for the crash…

It’s not a specific product that caused it, but all the products the user tries to purchase.

Our product id’s are all in the form of com.host.lower.caps.unique.name

I suspect the problem is related to the user’s Android OS, since a Bundle object is expected to be initialized and it’s null. 

What is the value of productId?

Since the platform is Android, the value of productId is a string representing the produce id in the Google Play store (it works for other Android users)

Sorry, I should have been more clear. I was hoping you would drop a print statement in and verify the value of productId when you get the crash. I was curious what the exact value was at the time of the crash.

Rob

I don’t understand why the actual product id’s we’re using are relevant for the crash…

It’s not a specific product that caused it, but all the products the user tries to purchase.

Our product id’s are all in the form of com.host.lower.caps.unique.name

I suspect the problem is related to the user’s Android OS, since a Bundle object is expected to be initialized and it’s null.