llewis3091 / marketbilling

Automatically exported from code.google.com/p/marketbilling
0 stars 0 forks source link

IabHelper (NullPointerException) launchPurchaseFlow #180

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
STEPS TO REPRODUCE:
1. It happens one time to me, no way to reproduce (seems to be random). Some 
report from users.

Calling the constructor in this way:

mHelper.launchPurchaseFlow(MainActivity.this, SKU_UNLOCKED, RC_REQUEST,
                                mPurchaseFinishedListener, "");

EXPECTED OUTPUT:

Launching the dialog to buy the in-app content.

ACTUAL OUTPUT:

NullPointerException.

OS VERSION: 4.4.2

MARKET/MYAPPS VERSION:

DEVICE: Nexus 4

OUTPUT FROM ADB BUGREPORT ATTACHED:

    java.lang.NullPointerException
            at com.fnp.audioprofiles.util.IabHelper.launchPurchaseFlow(IabHelper:386)
            at com.fnp.audioprofiles.util.IabHelper.launchPurchaseFlow(IabHelper:338)
            at com.fnp.audioprofiles.MainActivity$6.onClick(MainActivity:422)
            at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166)
            at android.os.Handler.dispatchMessage(Handler.java:102)
            at android.os.Looper.loop(Looper.java:136)
            at android.app.ActivityThread.main(ActivityThread.java:5017)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:515)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:779)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:595)
            at dalvik.system.NativeStart.main(Native Method)

Original issue reported on code.google.com by ferra...@gmail.com on 24 Feb 2014 at 11:58

GoogleCodeExporter commented 8 years ago
I have a report that has the same NPE issue on the same line.

Android version     Android 4.4
Device              HTC One (m7)

java.lang.NullPointerException
at 
com.solarsong.toomanycats.billing.util.IabHelper.launchPurchaseFlow(IabHelper.ja
va:386)
at 
com.solarsong.toomanycats.billing.util.IabHelper.launchPurchaseFlow(IabHelper.ja
va:338)
at org.cocos2dx.cpp.AppActivity.purchaseRemoveAds(AppActivity.java:247)
at org.cocos2dx.lib.Cocos2dxRenderer.nativeTouchesEnd(Native Method)
at org.cocos2dx.lib.Cocos2dxRenderer.handleActionUp(Cocos2dxRenderer.java:132)
at org.cocos2dx.lib.Cocos2dxGLSurfaceView$9.run(Cocos2dxGLSurfaceView.java:257)
at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1463)
at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)

The line in question is 
   Bundle buyIntentBundle = mService.getBuyIntent(3, mContext.getPackageName(), sku, itemType, extraData);

So either mService or mContext was null in this case.  I'm guessing that 
something was disposed mid-execution?

Original comment by thomas.d...@gmail.com on 23 Jul 2014 at 5:10