sms_autofill
sms_autofill copied to clipboard
java.lang.IllegalStateException: Reply already submitted
If I run these lines of code then doing a navigation to another screen and go back again, I get some android related errors.
Code snippet:
final _autoFill = SmsAutoFill();
final completePhoneNumber = await _autoFill.hint;
This issue seems be similar to this issue described here: https://github.com/flutter/flutter/issues/29092 "java.lang.IllegalStateException: Reply already submitted" However I am not sure whats going on there.
Errors I receive:
D/AndroidRuntime(32542): Shutting down VM
E/AndroidRuntime(32542): FATAL EXCEPTION: main
E/AndroidRuntime(32542): Process: app.xxx, PID: 32542
E/AndroidRuntime(32542): java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=11012, result=0, data=Intent { }} to activity {app.xxx/app.xxx.MainActivity}: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(32542): at android.app.ActivityThread.deliverResults(ActivityThread.java:5097)
E/AndroidRuntime(32542): at android.app.ActivityThread.handleSendResult(ActivityThread.java:5138)
E/AndroidRuntime(32542): at android.app.servertransaction.ActivityResultItem.execute(ActivityResultItem.java:51)
E/AndroidRuntime(32542): at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
E/AndroidRuntime(32542): at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
E/AndroidRuntime(32542): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2147)
E/AndroidRuntime(32542): at android.os.Handler.dispatchMessage(Handler.java:107)
E/AndroidRuntime(32542): at android.os.Looper.loop(Looper.java:237)
E/AndroidRuntime(32542): at android.app.ActivityThread.main(ActivityThread.java:7811)
E/AndroidRuntime(32542): at java.lang.reflect.Method.invoke(Native Method)
E/AndroidRuntime(32542): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
E/AndroidRuntime(32542): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1076)
E/AndroidRuntime(32542): Caused by: java.lang.IllegalStateException: Reply already submitted
E/AndroidRuntime(32542): at io.flutter.embedding.engine.dart.DartMessenger$Reply.reply(DartMessenger.java:139)
E/AndroidRuntime(32542): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler$1.success(MethodChannel.java:231)
E/AndroidRuntime(32542): at com.jaumard.smsautofill.SmsAutoFillPlugin$1.onActivityResult(SmsAutoFillPlugin.java:68)
E/AndroidRuntime(32542): at io.flutter.app.FlutterPluginRegistry.onActivityResult(FlutterPluginRegistry.java:204)
E/AndroidRuntime(32542): at io.flutter.app.FlutterActivityDelegate.onActivityResult(FlutterActivityDelegate.java:127)
E/AndroidRuntime(32542): at io.flutter.app.FlutterActivity.onActivityResult(FlutterActivity.java:139)
E/AndroidRuntime(32542): at android.app.Activity.dispatchActivityResult(Activity.java:8292)
E/AndroidRuntime(32542): at android.app.ActivityThread.deliverResults(ActivityThread.java:5090)
E/AndroidRuntime(32542): ... 11 more
I/Process (32542): Sending signal. PID: 32542 SIG: 9
Same here
Same,
From the issue you mention flutter/flutter#29092 it look like it happen only during development and it's cause by hot reload, meaning no issues on production. Ok it's annoying ^^ but not critical. Not sure what I can do about it so far but I'll search
I was getting this same issue & it was coming on production too.
Steps to reproduce in production (in my case):
- have a button on a screen that calls
hint
- double click the button fast, it would show the phone no dialog twice
- just close the dialogs by clicking outside. We get the error.
Possible solution: avoid multiple dialogs somehow, maybe my avoiding multiple clicks on the button before getting the first result or something.
This is happening in production also now it is critical ... on lower end devices if you tap twice on phone hint dialog it crashes @jaumard
Hi there! Have any one fixed this issue its coming in production.
+1
me same issue
Please check https://github.com/jaumard/sms_autofill/pull/199
Hi @jaumard
Just like what you have done on Line # 17 to Line # 25 on dart code and Line # 85 to Line # 87 on android code, we also need to implement the same method on Line # 30 on dart code and Line # 99 on android code to resolve this crash issue.
Reference attachment https://stackoverflow.com/questions/65666404/java-lang-illegalstateexception-reply-already-submitted-when-trying-to-call
What is the update on this? We can see still see this issue in our crashlytics even after upgrading to the latest version 2.3.0
we also facing same issue. Multiple crashes are reported on our Firebase Crashlytics. Any update or solution on this? please let us know if we have any solution.
flutter version -- 3.13.9 sms_autofill plugin version -- 2.3.0