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

Crash reports #71

Open
timeshift-ted opened this issue Sep 7, 2023 · 19 comments
Open

Crash reports #71

timeshift-ted opened this issue Sep 7, 2023 · 19 comments
Assignees

Comments

@timeshift-ted
Copy link

Crashlytics is reporting this crash is happening regularly:

Fatal Exception: java.lang.IllegalStateException
Reply already submitted
io.flutter.embedding.engine.dart.DartMessenger$Reply.reply (DartMessenger.java:435)
io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error (MethodChannel.java:268)
com.chargebee.flutter.sdk.ChargebeeFlutterSdkPlugin.error (ChargebeeFlutterSdkPlugin.kt:530)
com.chargebee.flutter.sdk.ChargebeeFlutterSdkPlugin.onError (ChargebeeFlutterSdkPlugin.kt:511)
com.chargebee.flutter.sdk.ChargebeeFlutterSdkPlugin.access$onError (ChargebeeFlutterSdkPlugin.kt:26)
com.chargebee.flutter.sdk.ChargebeeFlutterSdkPlugin$retrieveProducts$1.onError (ChargebeeFlutterSdkPlugin.kt:159)
com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$2.invoke (BillingClientManager.kt:51)
com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$2.invoke (BillingClientManager.kt:21)
com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$3.invoke (BillingClientManager.kt:69)
com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$3.invoke (BillingClientManager.kt:21)
com.chargebee.android.billingservice.BillingClientManager$createBillingClientStateListener$1.onBillingServiceDisconnected (BillingClientManager.kt:504)
com.android.billingclient.api.zzaf.onServiceDisconnected (com.android.billingclient:billing@@4.0.0:4)
android.app.LoadedApk$ServiceDispatcher.doDeath (LoadedApk.java:1967)
android.app.LoadedApk$ServiceDispatcher$RunConnection.run (LoadedApk.java:1982)
android.os.Handler.handleCallback (Handler.java:883)
android.os.Handler.dispatchMessage (Handler.java:100)
android.os.Looper.loop (Looper.java:214)
android.app.ActivityThread.main (ActivityThread.java:7356)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:492)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:930)

@cb-amutha
Copy link
Contributor

thanks @timeshift-ted for sharing the logs here.
As per the crash analytics logs, we could see the issue is while fetching the products from google store and unfortunately the app was unable to connect with google play billing service.
Could you please add the test account of google play store and try again. Thanks.

And also, will try to replicate the same issue in our example app and update it.

@timeshift-ted
Copy link
Author

timeshift-ted commented Sep 12, 2023 via email

@nikolashaag
Copy link

Hi @cb-amutha ,

we have 120 reports of the same error since going live 1 month ago. Also through Crashlytics.

What causes the failure to connect to Google Play services here?

@ciriousjoker
Copy link
Contributor

We also have this issue, but it's unclear why. I have a suspicion it's caused by the new default proguard rules in combination with a perhaps swallowed error, but I have no proof.

@ciriousjoker
Copy link
Contributor

ciriousjoker commented Oct 18, 2023

Here are stacktraces:

production via Crashlytics

Fatal Exception: java.lang.IllegalStateException: Reply already submitted
at bh.c$g.a(SourceFile:1)
at lh.k$a$a.b(SourceFile:1)
at b4.b.f(SourceFile:1)
at b4.b.h(SourceFile:1)
at b4.b.b(SourceFile:1)
at b4.b$i.onError(SourceFile:1)
at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$2.invoke(SourceFile:2)
at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$2.invoke(SourceFile:1)
at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$3.invoke(SourceFile:2)
at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$3.invoke(SourceFile:1)
at com.chargebee.android.billingservice.BillingClientManager$createBillingClientStateListener$1.onBillingServiceDisconnected(:15)
at u2.v.onServiceDisconnected(SourceFile:1)
at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:2382)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2397)
at android.os.Handler.handleCallback(Handler.java:942)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8762)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:604)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

Interestingly, the underlying error message is this:

flutter_error_exception | PlatformException(502, java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType, java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType, null)
flutter_error_reason | thrown purchase() failed.

in debug mode

Here, I opened the app, then logged into the Play Store on the emulator (might have called some callback in your sdk) and then resurfaced the app.

FATAL EXCEPTION: main
Process: com.dieringe.workout.debug, PID: 4621
java.lang.IllegalStateException: Reply already submitted
at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:435)
at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.error(MethodChannel.java:268)
at com.chargebee.flutter.sdk.ChargebeeFlutterSdkPlugin.error(ChargebeeFlutterSdkPlugin.kt:530)
at com.chargebee.flutter.sdk.ChargebeeFlutterSdkPlugin.onError(ChargebeeFlutterSdkPlugin.kt:511)
at com.chargebee.flutter.sdk.ChargebeeFlutterSdkPlugin.access$onError(ChargebeeFlutterSdkPlugin.kt:26)
at com.chargebee.flutter.sdk.ChargebeeFlutterSdkPlugin$retrieveProducts$1.onError(ChargebeeFlutterSdkPlugin.kt:159)
at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$2.invoke(BillingClientManager.kt:51)
at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$2.invoke(BillingClientManager.kt:21)
at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$3.invoke(BillingClientManager.kt:69)
at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$3.invoke(BillingClientManager.kt:21)
at com.chargebee.android.billingservice.BillingClientManager$createBillingClientStateListener$1.onBillingServiceDisconnected(BillingClientManager.kt:511)
at com.android.billingclient.api.zzaf.onServiceDisconnected(com.android.billingclient:billing@@6.0.1:5)
at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:2218)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2233)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:205)
at android.os.Looper.loop(Looper.java:294)
at android.app.ActivityThread.main(ActivityThread.java:8177)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:971)

This suggests missing proguard rules.
We're using chargebee_flutter: v0.2.1.

@ciriousjoker
Copy link
Contributor

Issue is also reproducible in v0.3.0... this is affecting our production users who can't do purchases, please fix this asap.

@ciriousjoker
Copy link
Contributor

ciriousjoker commented Nov 2, 2023

Here are reproduction steps:

  1. Open Play Store
  2. Open the own app
  3. Open random other app
  4. Close Play Store
  5. Switch back to the app (it crashed)

Basically, closing the Play Store crashes the app if it's in the background. If it's in the foreground, nothing happens.
ProGuard/no ProGuard makes no difference.

@cb-haripriyan
Copy link
Contributor

Thanks for the steps to reproduce @ciriousjoker
We are looking into this and will update here about the progress.

@ciriousjoker
Copy link
Contributor

@cb-haripriyan Any news?

@cb-haripriyan
Copy link
Contributor

We have identified the underlying case which was causing the multiple call backs. The Billing Library calls the listeners multiple times during disconnection/reconnection, which in turns causes multiple callbacks on Flutter. We are working on a method to avoid this.

@ciriousjoker
Copy link
Contributor

@cb-haripriyan Any eta for this? This is severely affecting our users.

@cb-haripriyan
Copy link
Contributor

@ciriousjoker We are targeting this for early next week.

@ciriousjoker
Copy link
Contributor

ciriousjoker commented Dec 6, 2023

@cb-haripriyan Do you have an update on this?

This issue produces almost 300 crashes per week on Android

@cb-haripriyan
Copy link
Contributor

@ciriousjoker We are expecting to release a fix by utmost tomorrow.
Apologies, we were delayed due to unforeseen circumstances.

@cb-haripriyan
Copy link
Contributor

@ciriousjoker @timeshift-ted
This should be fixed in the version 0.4.1. Can you please check and confirm?

@ciriousjoker
Copy link
Contributor

Will try out asap, we'll probably have meaningful crash reporting statistics by the end of next week.

@ciriousjoker
Copy link
Contributor

@cb-haripriyan This doesn't seem to happen nearly as often anymore as this one, but apparently it still exists in v1.0.0-beta.2.

Stacktrace

Fatal Exception: java.lang.IllegalStateException: Reply already submitted
       at lh.c$g.a(SourceFile:1)
       at uh.k$a$a.b(SourceFile:1)
       at h4.b.f(SourceFile:1)
       at h4.b.g(SourceFile:1)
       at h4.b.b(SourceFile:1)
       at h4.b$i.onError(SourceFile:1)
       at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$2.invoke(SourceFile:2)
       at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$2.invoke(SourceFile:1)
       at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$3.invoke(SourceFile:2)
       at com.chargebee.android.billingservice.BillingClientManager$retrieveProducts$3.invoke(SourceFile:1)
       at com.chargebee.android.billingservice.BillingClientManager$createBillingClientStateListener$1.onBillingServiceDisconnected(:15)
       at c3.u.onServiceDisconnected(SourceFile:1)
       at android.app.LoadedApk$ServiceDispatcher.doDeath(LoadedApk.java:2226)
       at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:2241)
       at android.os.Handler.handleCallback(Handler.java:959)
       at android.os.Handler.dispatchMessage(Handler.java:100)
       at android.os.Looper.loopOnce(Looper.java:232)
       at android.os.Looper.loop(Looper.java:317)
       at android.app.ActivityThread.main(ActivityThread.java:8501)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:878)

Perhaps this happens if a user signs into or out of the Play Store while the app is running?

@cb-haripriyan
Copy link
Contributor

@ciriousjoker Missed updating it here. The version v1.0.0-beta.4 includes the fix for this.

@ciriousjoker
Copy link
Contributor

The fix solved the issue, this can probably be closed for now and reopened if it occurs again

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