Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

InAppBilling : crash on Android when stopping the service shortly after a getProducts call #74

Closed
VoodooGames opened this issue May 5, 2014 · 5 comments
Assignees

Comments

@VoodooGames
Copy link

Hi,

When calling InAppBilling.service.dispose() shortly (almost instantly) after a call to InAppBilling.service.getProducts, the app crashes on Android.

In the bug report, we have a NullPointerException in the "queryPurchases" method of the IabHelper class.

I assume we try to access a ressource disposed by the InAppBilling.service.stop() method.

Is this a real bug and if so, can you provide a temporary workaround until the bug is fixed?

Thanks for your help.

@marchbold
Copy link
Contributor

Hi,

What are you trying to do?

Calling dispose in the middle of an operation will have undefined results as it clears the extensions resources. This should only be called when you are completely finished using the functionality of the extension.

What is the InAppBilling.service.stop() method you are referring to? This function doesn't exist in the extension?

@VoodooGames
Copy link
Author

I meant InAppBilling.service.dispose().

I have a panel displaying products that the user can buy. When opening the panel, i call setup() then getProducts().
When closing the panel, i call dispose().

The problem is when the user opens and close the panel really fast : the dispose() method is called right after getProducts(), which leads to the crash.

I may be able to find a workaround to avoid the crash (like delaying the dispose() call when the products are received) but maybe there's a more elegant way to do it.

Thanks for your help

@frtykt
Copy link

frtykt commented May 7, 2014

i have same problem, plesa help us for this.

@frtykt
Copy link

frtykt commented May 10, 2014

i installed updated ane and chanced code on TestInAppBilling but dosent fixed, when i call getproduct( ) after setup device says the app crashes on Android. this problem being only already PURCHASED products.

@marchbold
Copy link
Contributor

We haven't added this feature. For the moment I suggest you keep a check if you have an operation under operation and do not call dispose until it's completed.

Cheers

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants