Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalStateException on Google Play billing when started twice #29

Open
arpitkh96 opened this issue Dec 20, 2015 · 9 comments
Open

IllegalStateException on Google Play billing when started twice #29

arpitkh96 opened this issue Dec 20, 2015 · 9 comments

Comments

@arpitkh96
Copy link

As far as i know its not allowed to run multiple asynctask for google in app billing.But this library is creating new tasks if pressed donate button twice.Maybe it needs to check if a task is already running and react according to it.

12-20 22:29:20.860 8218-8218/? E/AndroidRuntime: java.lang.IllegalStateException: Can't start async operation (launchPurchaseFlow) because another async operation(launchPurchaseFlow) is in progress.
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at org.sufficientlysecure.donations.google.util.IabHelper.flagStartAsync(IabHelper.java:820)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at org.sufficientlysecure.donations.google.util.IabHelper.launchPurchaseFlow(IabHelper.java:374)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at org.sufficientlysecure.donations.DonationsFragment.donateGoogleOnClick(DonationsFragment.java:350)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at org.sufficientlysecure.donations.DonationsFragment$1.onClick(DonationsFragment.java:226)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at android.view.View.performClick(View.java:4785)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at android.view.View$PerformClick.run(View.java:19884)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at android.os.Handler.handleCallback(Handler.java:746)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at android.os.Handler.dispatchMessage(Handler.java:95)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at android.os.Looper.loop(Looper.java:135)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at android.app.ActivityThread.main(ActivityThread.java:5343)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Native Method)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at java.lang.reflect.Method.invoke(Method.java:372)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:907)
12-20 22:29:20.860 8218-8218/? E/AndroidRuntime:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:702)
@dschuermann dschuermann changed the title FC due to already running task IllegalStateException on Google Play billing when started twice Feb 11, 2016
@AllanWang
Copy link
Contributor

I am currently also experiencing this issue. My older apps (which probably aren't using 2.4) are not.

03-05 02:26:29.933 10033-10033/com.pitchedapps.material.glass.free E/AndroidRuntime: FATAL EXCEPTION: main Process: com.pitchedapps.material.glass.free, PID: 10033 java.lang.IllegalStateException: Can't start async operation (launchPurchaseFlow) because another async operation(launchPurchaseFlow) is in progress. at org.sufficientlysecure.donations.google.util.IabHelper.flagStartAsync(IabHelper.java:821) at org.sufficientlysecure.donations.google.util.IabHelper.launchPurchaseFlow(IabHelper.java:375) at com.pitchedapps.material.glass.fragments.DonationsFragment.donateGoogleOnClick(DonationsFragment.java:359) at com.pitchedapps.material.glass.fragments.DonationsFragment$1.onClick(DonationsFragment.java:235) at android.view.View.performClick(View.java:5204) at android.view.View$PerformClick.run(View.java:21154) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.app.ActivityThread.main(ActivityThread.java:5417) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616) at de.robv.android.xposed.XposedBridge.main(XposedBridge.java:117)

@mx1up
Copy link

mx1up commented Mar 5, 2016 via email

@AllanWang
Copy link
Contributor

And if you want to press the button a second time?

@mx1up
Copy link

mx1up commented Mar 5, 2016 via email

@dschuermann
Copy link
Member

@AllanWang
Copy link
Contributor

Sorry, my bad. It seems like I didn't the on activity created part. All is working now for me

@dschuermann
Copy link
Member

The README should be improved to describe the usage of the onActivityResult delegation.

@btimofeev
Copy link
Contributor

I have same issue. My onActivityResult is the same as in example. My code is here https://github.com/btimofeev/UniPatcher/blob/master/app/src/google/java/org/emunix/unipatcher/ui/activity/DonateActivity.java

Android 6.0.1
Google Play Services 10.0.84

@dschuermann
Copy link
Member

I added a better explanation to the README to pass through results to the fragment in onActivityResult. I don't know why other crashes still happen.

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

No branches or pull requests

5 participants