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

java.lang.IllegalStateException: IAB helper is not set up #199

Closed
MarcinLament opened this issue Apr 26, 2014 · 13 comments
Closed

java.lang.IllegalStateException: IAB helper is not set up #199

MarcinLament opened this issue Apr 26, 2014 · 13 comments

Comments

@MarcinLament
Copy link

A considerable number of my users get this exception. However, I cannot reproduce it on any of my devices.

java.lang.IllegalStateException: IAB helper is not set up. Can't perform operation: queryInventory
at org.onepf.oms.appstore.googleUtils.IabHelper.checkSetupDone(IabHelper.java:806)
at org.onepf.oms.appstore.googleUtils.IabHelper.queryInventory(IabHelper.java:566)
at org.onepf.oms.OpenIabHelper.queryInventory(OpenIabHelper.java:930)
at org.onepf.oms.OpenIabHelper$5.run(OpenIabHelper.java:957)
at java.lang.Thread.run(Thread.java:864)

I can see that you throw IllegalStateException when mSetupDone is false in checkSetupDone() in org.onepf.oms.appstore.googleUtils.IabHelper

I guess we could add 'catch (IllegalStateException ex)' to the queryInventoryAsync method in OpenIabHelper to handle this exception.

@akarimova
Copy link
Contributor

answer #200 question, please

@MarcinLament
Copy link
Author

Do you have any update on that problem maybe? I get quite a lot of crashes every day.

@akarimova
Copy link
Contributor

Please log your threads. Must be the same thread, but according to your log it is not.

@oorlov
Copy link
Contributor

oorlov commented May 14, 2014

Hi @marqs87

Could you try this version of OpenIAB and let me know?

http://yadi.sk/d/F3y6KrD_QFJPr It has updated synchronization model

@oorlov oorlov added the support label May 14, 2014
@MarcinLament
Copy link
Author

It will be difficult as I can't reproduce the problem myself and I won't be able to use it in my release because I already use customized version of OnePF due to the Amazon null pointer exceptions I logged here some time ago.

@adriandiesel
Copy link

I'm having the same issue
java.lang.IllegalStateException: IAB helper is not set up. Can't perform operation: queryInventory
at org.onepf.oms.appstore.googleUtils.IabHelper.checkSetupDone(IabHelper.java:806)
at org.onepf.oms.appstore.googleUtils.IabHelper.queryInventory(IabHelper.java:566)
at org.onepf.oms.OpenIabHelper.queryInventory(OpenIabHelper.java:930)
at org.onepf.oms.OpenIabHelper$5.run(OpenIabHelper.java:957)
at java.lang.Thread.run(Thread.java:841)

@cmdeviant
Copy link

I'm currently use OpenIAB 0.9.6 (Unity plugin) and have the same issue as @adriandiesel:
Here is stack trace from Flurry and list of devices where this exception occurred since 0.9.4 OpenIAB version:

java.lang.IllegalStateException
org.onepf.oms.appstore.googleUtils.IabHelper.checkSetupDone(IabHelper.java:806)
org.onepf.oms.appstore.googleUtils.IabHelper.queryInventory(IabHelper.java:566)
org.onepf.oms.OpenIabHelper.queryInventory(OpenIabHelper.java:930)
org.onepf.oms.OpenIabHelper$5.run(OpenIabHelper.java:957)
java.lang.Thread.run(Thread.java:856)

Crashes by devices

Devices Occurrences
Samsung Galaxy Tab 2 10.1 15
Huawei Ascend G510 5
RoverPad Sky C70 3
Huawei MediaPad 10 LINK 2
Samsung Galaxy Fresh S7390 1
Huawei MediaPad 7 Youth 1
Samsung Galaxy Ace 3 1
Samsung Galaxy Tab 3 7.0 1
Sony Xperia E Dual C1605 1
Asus FonePad ME371MG 1
Samsung Galaxy Fame 1
Samsung Galaxy Star GT-S5282 1
Philips W732 1
Huawei MediaPad 7 Lite 1
Motorola Razr i XT890 1

Crashes by firmware

Firmware Occurrences
Android 4.0.4 18
Android 4.2.2 10
Android 4.1.2 9
Android 4.1.1 9
Android 4.0.3 4
Android 4.2.1 1

Hope this data can help.

Also I never can catch this bug myself on my test devices.

oorlov pushed a commit that referenced this issue May 22, 2014
@oorlov oorlov added this to the 0.9.7 milestone May 22, 2014
@oorlov
Copy link
Contributor

oorlov commented May 22, 2014

Please, find fixed version on 'master'. Artifacts will be released in 0.9.7 soon

@oorlov
Copy link
Contributor

oorlov commented May 22, 2014

If meet with some unexpected cases after OpenIAB update, please let us know

@sbaar
Copy link

sbaar commented Jun 9, 2014

I'm having trouble adding openiab as a library project with gradle in android studio. Any eta on .9.7 or any way to mitigate the issue until then?

@oorlov
Copy link
Contributor

oorlov commented Jun 9, 2014

Hi @sbaar!

Currently we don't support gradle for OpenIAB. I suggest to simply put OpenIAB.jar to /libs folder of Android project layout. Android default build procedure should pick it up.
OpenIAB.jar could be downloaded from http://www.onepf.org/openiab/ or compiled from source using
and clean && ant build

If doesn't work, please let me know!

@sbaar
Copy link

sbaar commented Jun 9, 2014

Sorry, I was unclear in my last response. I can do that fine, it's just im getting intermittent crashes reported in this issue. I'll try ant later tonight (although from experience ant hates me). Is there any specific version of ant I need to use? If not I'll just wait for the next jar, I was just wondering when that would be.

@oorlov
Copy link
Contributor

oorlov commented Jun 9, 2014

Issue is fixed in 0.9.7-pre, you can try .jar from here http://yadi.sk/d/A4GzFHfsSY8r6

I expect to finish with 0.9.7 this week. Need to finish with several pull-requests first

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

No branches or pull requests

6 participants