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
Fix IllegalStateException in getPurchaseHistory for Android #336
Fix IllegalStateException in getPurchaseHistory for Android #336
Conversation
Codecov Report
@@ Coverage Diff @@
## master #336 +/- ##
=======================================
Coverage 45.97% 45.97%
=======================================
Files 3 3
Lines 435 435
=======================================
Hits 200 200
Misses 235 235
Continue to review full report at Codecov.
|
I am getting this error as well. v5.1.2. |
@mgonzalezc thy very much for this pr, but I am still getting the same error with this commit. flutter_inapp_purchase:
git:
url: git@github.com:mgonzalezc/flutter_inapp_purchase.git
ref: fix/mindapps_fix .pub-cache reveal the right dependency being loaded:
|
Hello! Sorry about that! To be honest, this was a quick fix I made to have the plugin working with my own code. However, I think the issue is deeper and may need a bit more thinking. Now, I am thinking you could get the same error if you call getPurchaseHistory twice synchronously. There might be other cases when it fails as well |
When I delete handler, the package doesn't respond. The future is waiting and waiting and doesn't respond. This was the same problem I got in in_app_purchase. |
…deleting handler" This reverts commit ae8029d.
Sorry, @dineshinworld I was trying to test a few things and completely forgot that I had this PR opened in the same branch... I have reverted it now. It worked for me without the handlers though. |
This PR is stale because it has been open 90 days with no activity. Leave a comment or this will be closed in 7 days |
The method getPurchaseHistory raises an IllegalStateException: Reply already submitted in Android
I am not sure if this is the best way to fix the issue because it makes the function slower, but at least the exception isn't thrown anymore
java.lang.IllegalStateException: Reply already submitted
at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:164)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:238)
at com.dooboolab.flutterinapppurchase.MethodResultWrapper$1.run(MethodResultWrapper.java:27)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7838)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)