Skip to content

[in_app_purchase] java.lang.IllegalStateException: Reply already submitted #134967

Closed as not planned

Description

@serhii-k

Is there an existing issue for this?

What package does this bug report belong to?

in_app_purchase

What target platforms are you seeing this bug on?

Android

Have you already upgraded your packages?

Yes

Dependency versions

pubspec.lock
  in_app_purchase:
    dependency: "direct main"
    description:
      name: in_app_purchase
      sha256: "944b9a9d8cce41a0ac057dd6984c942f01bfed9a8106247f2f630b06f5db8aab"
      url: "https://pub.dev"
    source: hosted
    version: "3.1.8"
  in_app_purchase_android:
    dependency: "direct main"
    description:
      name: in_app_purchase_android
      sha256: "8326f68ee8c286f207570ee6150a918ef413fdaaf8e653bf58bbdc01e1474ead"
      url: "https://pub.dev"
    source: hosted
    version: "0.3.0+11"
  in_app_purchase_platform_interface:
    dependency: transitive
    description:
      name: in_app_purchase_platform_interface
      sha256: ba5d4d7059ba512907382dce363eabab53c0826ecb23cfb40c58cec6141ea105
      url: "https://pub.dev"
    source: hosted
    version: "1.3.3"
  in_app_purchase_storekit:
    dependency: transitive
    description:
      name: in_app_purchase_storekit
      sha256: "3c73cbebff4365fbb0bef182f35b07e45087f598378f5b676f5825145d5bdbdb"
      url: "https://pub.dev"
    source: hosted
    version: "0.3.6+3"

Steps to reproduce

In Crashlytics I see an annoying bug that is caused inside the [in_app_purchase] plugin.

It happens:

  • in 94% cases on Huawei devices
  • 89% Android 8
  • 97% background

To my wonder I have a huge audience with such devices (e.g. for the last 7 days 77 users affected).

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

Please check these stack traces from Crashlytics:

Stack trace 1 (very common)
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:808)
       at android.os.Handler.dispatchMessage(Handler.java:101)
       at android.os.Looper.loop(Looper.java:166)
       at android.app.ActivityThread.main(ActivityThread.java:7529)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)
Stack trace 2 (much less common)
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$queryPurchasesAsync$2(MethodCallHandlerImpl.java:33)
       at com.android.billingclient.api.BillingClientImpl.zzL(BillingClientImpl.java:19)
       at com.android.billingclient.api.zzu.run(zzu.java:4)
       at com.android.billingclient.api.zzw.run(zzw.java:29)
       at android.os.Handler.handleCallback(Handler.java:809)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:166)
       at android.app.ActivityThread.main(ActivityThread.java:7555)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:469)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:963)

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-arm64, locale en-IC)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2022.2)
[✓] Connected device (3 available)
[✓] Network resources

Activity

  1. darshankawar commented on Sep 19, 2023

    @darshankawar
    Member

    Looking at the error log, it seems to be similar to #103432, so please follow-up in it for further updates. You may share your findings in that issue for better tracking.
    Closing this as a duplicate.

  2. added
    r: duplicateIssue is closed as a duplicate of an existing issue
    and removed
    in triagePresently being triaged by the triage team
    on Sep 19, 2023
  3. github-actions commented on Oct 3, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  4. locked as resolved and limited conversation to collaborators on Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions