I am using the IabHelper
utility classes, as recommended by Google\'s tutorial, and I\'m being hit hard by this error. Apparently IabHelper
can not
This was not easy to crack but I found the needed workarounds. Quite disappointed with Google lately, their Android web sites have become a mess (very hard to find useful info) and their sample code is poor. When I was doing some Android development a few years ago it all went so much easier! This is yet another example of that...
Indeed IabUtil is buggy, it does not properly call off its own async tasks. The complete set of necessary workarounds to stabilise this thing:
1) make method flagEndAsync
public. It is there, just not visible.
2) have every listener call iabHelper.flagEndAsync
to make sure the procedure is marked finished properly; it seems to be needed in all listeners.
3) surround calls with a try/catch
to catch the IllegalStateException
which may occur, and handle it that way.