I’ve been struggling with Android IAB v3 for some time now. I am constantly working on my test devices. However, my crash reporting service shows two recurring failures: one for null pointer exception and one for exception due to illegal state. I tried to update the Google sample code with numerous suggestions from Stackoverflow users facing similar issues. I went through the “read crash reports, do research, try to fix the crash, send updates, see the same crash reports”, cycle several times. I think the time has come for a different approach.
If you started with Android IAB today, what would you choose as the most modern, correct resource for code samples, patches, documentation, etc.
This should not be the only resource. Any combination of sample code, corrections from SO posts, blog posts, or even an “update from the Android SDK Manager” will be helpful. Ideally, we can create a resource for people new to the IAB that prevents their headaches and tries to try to integrate the service.
edit 1 : more information about crashes
java.lang.IllegalStateException: Can't start async operation (refresh inventory) because another async operation(launchPurchaseFlow) is in progress. at com.android.vending.billing.IabHelper.flagStartAsync(IabHelper.java:832) at com.android.vending.billing.IabHelper.queryInventoryAsync(IabHelper.java:623) at com.android.vending.billing.IabHelper.queryInventoryAsync(IabHelper.java:651) ... java.lang.NullPointerException at com.android.vending.billing.IabHelper.launchPurchaseFlow(IabHelper.java:398) at com.android.vending.billing.IabHelper.launchPurchaseFlow(IabHelper.java:350) ...
These are two exceptions. They are not always in the same places on IabHelper. Maybe I could just fix them, but that doesn't seem like the right way to solve this problem. In addition, it does not help anyone.
It’s possible that I am using an outdated sample of Google code. However, I searched quite a bit and could not find anything more recent.
source share