Closed Maktos closed 8 years ago
Based on "Illegal state for operation (queryInventory): IAB helper setup is in progress." I'd say you are calling the purchase manager before "handleInstall" has returned. Please make sure that installation has completed before you call any of the purchase manager functions.
How would I do this? I'm not actually calling "queryInventory" for example. That's done automatically by gdx-pay. How would I ask gdx-pay if it's done with handleInstall? I guess my point is that I'm not in full control, using a library that abstracts a lot of this.
You need to wait for handleInstall(...) to return (meaning install was successful). After that, you can do a purchase restore but not before! Also watch out if handleInstallError(...) was called meaning there was an error installing/registering the purchasing system!
I have this problem as well and I can't seem to figure out how to fix it, as I'm not the one calling the code. I'm not sure where or how I should wait for handleInstall, as you said above.
You need to call:
PurchaseSystem.install(new PurchaseObserver() { ... }
Then wait for the PurchaseObserver's handleInstall to return (or the error condition!). You can't start any transaction etc. until handleInstall/handleInstallError has returned.
Is this resolved? Comments?
No response: assuming resolved.
09-15 20:16:57.952: E/OpenIAB(6040): Illegal state for operation (queryInventory): IAB helper setup is in progress. 09-15 20:16:57.952: W/dalvikvm(6040): threadid=14: thread exiting with uncaught exception (group=0x40c431f8) 09-15 20:16:57.962: E/AndroidRuntime(6040): FATAL EXCEPTION: GLThread 569 09-15 20:16:57.962: E/AndroidRuntime(6040): java.lang.IllegalStateException: IAB helper setup is in progress. Can't perform operation: queryInventory 09-15 20:16:57.962: E/AndroidRuntime(6040): at org.onepf.oms.OpenIabHelper.checkSetupDone(OpenIabHelper.java:1545) 09-15 20:16:57.962: E/AndroidRuntime(6040): at org.onepf.oms.OpenIabHelper.queryInventoryAsync(OpenIabHelper.java:1441) 09-15 20:16:57.962: E/AndroidRuntime(6040): at com.badlogic.gdx.pay.android.openiab.PurchaseManagerAndroidOpenIAB.purchaseRestore(PurchaseManagerAndroidOpenIAB.java:364) 09-15 20:16:57.962: E/AndroidRuntime(6040): at com.twosquidgames.ninesquids.handlers.PlatformResolver.requestPurchaseRestore(PlatformResolver.java:56) 09-15 20:16:57.962: E/AndroidRuntime(6040): at com.twosquidgames.ninesquids.NineSquids.create(NineSquids.java:1347)