Repository navigation
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: productionIssues experienced in live production appsIssues experienced in live production appsc: crashStack traces logged to the consoleStack traces logged to the consoleneeds repro infoAutomated crash report whose cause isn't yet knownAutomated crash report whose cause isn't yet knownp: in_app_purchasePlugin for in-app purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Description
I've got an error through Crashlytics
with in_app_purchase: ^3.0.2
Steps to Reproduce
I couldn't reproduce it locally but I guess it happens because of a race condition
Logs
Fatal Exception: java.lang.IllegalStateException: Reply already submitted
at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:35)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:14)
at io.flutter.plugins.inapppurchase.MethodCallHandlerImpl$1.onSkuDetailsResponse(MethodCallHandlerImpl.java:30)
at com.android.billingclient.api.zzac.run(zzac.java:36)
at android.os.Handler.handleCallback(Handler.java:790)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:210)
at android.app.ActivityThread.main(ActivityThread.java:7080)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:523)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:863)</summary>
Flutter version
Flutter 2.10.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 5464c5bac7 (3 weeks ago) • 2022-04-18 09:55:37 -0700
Engine • revision 57d3bac3dd
Tools • Dart 2.16.2 • DevTools 2.9.2
Running flutter doctor...
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.10.5, on Microsoft Windows [Version 10.0.19043.1645], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[√] Chrome - develop for the web
[!] Visual Studio - develop for Windows (Visual Studio Build Tools 2017 15.9.25)
X Visual Studio 2019 or later is required.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default components
[√] Android Studio (version 2020.3)
[√] VS Code (version 1.67.0)
[√] Connected device (3 available)
[√] HTTP Host Availability
Reacted by FluffyBunniesTasteTheBest, Asjad, JoonasN and Rohan Sohonee
Reacted by ozzy1873 and serhii-k
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: productionIssues experienced in live production appsIssues experienced in live production appsc: crashStack traces logged to the consoleStack traces logged to the consoleneeds repro infoAutomated crash report whose cause isn't yet knownAutomated crash report whose cause isn't yet knownp: in_app_purchasePlugin for in-app purchasePlugin for in-app purchasepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyAndroid applications specificallyteam-androidOwned by Android platform teamOwned by Android platform teamtriaged-androidTriaged by Android platform teamTriaged by Android platform team
Activity
darshankawar commentedon May 11, 2022
Seems to be indeed coming from the plugin. There was an old similar but fixed issue: #32462
Labeling it for further investigation as there doesn't seem to be reproducible use case.
deskangel commentedon Apr 12, 2023
encounter the same issue.
3 remaining items
ozzy1873 commentedon Sep 8, 2023
I am seeing this too:
Fatal Exception: java.lang.IllegalStateException: Reply already submitted
at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:35)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:14)
at io.flutter.plugins.inapppurchase.MethodCallHandlerImpl.lambda$queryProductDetailsAsync$0(MethodCallHandlerImpl.java:26)
at com.android.billingclient.api.BillingClientImpl.zzJ(BillingClientImpl.java:19)
at com.android.billingclient.api.zzl.run(zzl.java:4)
at com.android.billingclient.api.zzw.run(zzw.java:29)
at android.os.Handler.handleCallback(Handler.java:900)
at android.os.Handler.dispatchMessage(Handler.java:103)
at android.os.Looper.loop(Looper.java:219)
at android.app.ActivityThread.main(ActivityThread.java:8668)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1109)
serhii-k commentedon Sep 19, 2023
Hello, I don't think my comment is related to the original issue, however it seems to be related with @deskangel and @ozzy1873 comments.
In Crashlytics recently I started to see plenty of similar crashes (for the past 7 days 77 users affected).
Important (which may be different to the original issue)
In the case of my app the crashes happen:
Please check these stack traces from Crashlytics:
Stack trace 1 (very common)
Stack trace 2 (much less common)
serhii-k commentedon Sep 19, 2023
I have found that developers of RevenueCat also had a similar issue that happened mostly on Huawei devices which was resolved after some investigation. Maybe that can be helpful in the resolution of this issue.
RevenueCat/purchases-flutter#245
youssefali424 commentedon Sep 30, 2023
@darshankawar RevenueCat/purchases-flutter#245 (comment)
please look at this comment if possible I think this is the issue.
this issue has been active for so long and it affected a lot of our user base but at the same time it is hard to reproduce but crashlytics reports it frequently.
putnokiabel commentedon Oct 30, 2023
Looks like the original issue originates from
onSkuDetailsResponse.I just wanted to add that I'm seeing the same issue from
queryProductDetailsAsyncon the latest version of the plugin:Seems to happen exclusively on Samsung and Huawei devices on my end, and 100% of the crashes happen when the app is in the background:

Edit:
I looked into the revenuecat issue mentioned before and it looks like the same issue is relevant here.
RevenueCat/purchases-android#369 mentions:
"BillingClient, in some cases, issues multiple responses to the querySkuDetailsAsync and queryPurchaseHistoryAsync callbacks. This was causing crashes for Flutter users and is currently the top crash in the sdk console."
Meaning the plugin needs to take care that even if
querySkuDetailsAsyncissues multiple responses, only the first should be taken into account.FluffyBunniesTasteTheBest commentedon Jul 8, 2024
Same here with version 3.1.13 and a slightly different stack trace. Happens mainly on Huawei devices, though some Samsung, Nokia and TCL devices are reported as well. 56 effected users, of which 30 are running either Android 8 or 8.1. The remaining 26 crashes are distributed over Android 9 - 14.
Second stack trace got reported for five users:
AsjadSiddiqui commentedon Jul 27, 2024
Same here with 3.22.3
Stack trace from Vivo S19 running Android 14
More stack traces from Itel P17 running Android 11
jiagengArctuition commentedon Sep 4, 2025
same here with flutter
3.27.4andin_app_purchase_android: 0.4.0+2[in_app_purchase_android] Guard async billing callbacks against dupli…