wuyxhero / marketbilling

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

NPE when purchasing already owned item #113

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
STEPS TO REPRODUCE:

1. call IabHelper.launchPurchaseFlow() for already owned item.

ACTUAL OUTPUT:

Application crashes somewhere inside launchPurchaseFlow(Activity act, String 
sku, String itemType, int requestCode, OnIabPurchaseFinishedListener listener, 
String extraData).

I can't figure out exact place, cause stack-trace points to non-sense -
IabHelper.java:333 where simply function call is made, no access that could 
cause NPE.
I suspect it's because I'm using ProGuard.

NOTES:
I've found a way to workaround this issue. (Don't know how to do the .patch 
file, so try to explain here)

It seems that "else" clause is missing inside "try" block of the 
"launchPurchaseFlow" method.
All code after if-block (response != BILLING_RESPONSE_RESULT_OK) should be 
placed into "else" block.

Also in "catch" clauses one should call flagEndAsync().

Hope that helps somebody.

Original issue reported on code.google.com by coder....@gmail.com on 3 Apr 2013 at 12:50

GoogleCodeExporter commented 8 years ago
This patch fixes the problem.

Another patch is here:

https://code.google.com/p/marketbilling/source/diff?spec=svn5f6b7abfd0534acd5bfc
7c14436f4500c99e0358&r=5f6b7abfd0534acd5bfc7c14436f4500c99e0358&format=side&path
=/v3/src/com/example/android/trivialdrivesample/util/IabHelper.java&old_path=/v3
/src/com/example/android/trivialdrivesample/util/IabHelper.java&old=ba61fb3aaad4
3650b1f0e73d6057d5374ff43518

Original comment by KurtHu...@gmail.com on 23 Jul 2013 at 1:41

Attachments: