You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
java.lang.NullPointerException
at net.robotmedia.billing.BillingController.startPurchaseIntent(SourceFile:564)
at net.robotmedia.billing.helper.AbstractBillingObserver.onPurchaseIntent(SourceFile:58)
at net.robotmedia.billing.BillingController.onPurchaseIntent(SourceFile:324)
at net.robotmedia.billing.BillingRequest$RequestPurchase.processOkResponse(SourceFile:128)
at net.robotmedia.billing.BillingRequest.getRequestType(SourceFile:240)
run
at net.robotmedia.billing.BillingService.runRequest(SourceFile:246)
at net.robotmedia.billing.BillingService.runPendingRequests(SourceFile:226)
at net.robotmedia.billing.BillingService.onServiceConnected(SourceFile:147)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1064)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1081)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3647)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
The text was updated successfully, but these errors were encountered:
I also had quite a lot of those Exception. I figured out that many of them came from Google Play Store responses without a notificationId. If the response comes from a refunded or canceled purchase, the plugin won't know about bit and try to confirm a 'null' id. Here's my proposed fix which seems to get rid of some of these Exceptions:
In BillingController.java, function onPurchaseStateChanged you see the following (approx. line 422)
if (p.notificationId != null && automaticConfirmations.contains(p.productId)) {
confirmations.add(p.notificationId);
} else {
// TODO: Discriminate between purchases, cancellations and
// refunds.
addManualConfirmation(p.productId, p.notificationId);
}
Replace by:
if (p.notificationId != null && automaticConfirmations.contains(p.productId)) {
confirmations.add(p.notificationId);
} else {
// TODO: Discriminate between purchases, cancellations and
// refunds.
if (p.notificationId != null) {
addManualConfirmation(p.productId, p.notificationId);
}
}
the replaced code above makes the code much more stable in my case. there are still very rare crashes of the billinglibrary, but the app has been released and in-app purchases are running fine without customer complaints.
Hi,
I'm seeing a lot of NullPointer Exception:
java.lang.NullPointerException
at net.robotmedia.billing.BillingController.startPurchaseIntent(SourceFile:564)
at net.robotmedia.billing.helper.AbstractBillingObserver.onPurchaseIntent(SourceFile:58)
at net.robotmedia.billing.BillingController.onPurchaseIntent(SourceFile:324)
at net.robotmedia.billing.BillingRequest$RequestPurchase.processOkResponse(SourceFile:128)
at net.robotmedia.billing.BillingRequest.getRequestType(SourceFile:240)
run
at net.robotmedia.billing.BillingService.runRequest(SourceFile:246)
at net.robotmedia.billing.BillingService.runPendingRequests(SourceFile:226)
at net.robotmedia.billing.BillingService.onServiceConnected(SourceFile:147)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1064)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1081)
at android.os.Handler.handleCallback(Handler.java:587)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:123)
at android.app.ActivityThread.main(ActivityThread.java:3647)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:507)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
at dalvik.system.NativeStart.main(Native Method)
The text was updated successfully, but these errors were encountered: