Open zxcpsd opened 2 years ago
I can reproduce this on android
, but it doesn't seem to reproduce on iOS
with the same steps I used to reproduce on android
. The exception doesn't stop the app from working, and it probably isn't noticeable if you're using flutter run
.
TextField
In the video below, you see at a certain point, I'm typing but there's no text, that is because the debugger catches the exception and the app is paused. After resuming the app, that's when the text is captured in the textfield.
cc @LongCatIsLooong
cc @LongCatIsLooong
still reproduced, please check
Reproduced also in Flutter 3.10.7 Dart 3.0.7. Found via Sentry alerting from multiple customers. It seems like there are a few different errors that can be hit when trying the same repro steps in a production build or in debug in emulator.
we still get this with Flutter 3.22.0
and as you can see within the last 30 days it happened 1.7k times
PlatformException
PlatformException(error, invalid composing start: 21, null, java.lang.IndexOutOfBoundsException: invalid composing start: 21
at oa.s$e.<init>(TextInputChannel.java:15)
at oa.s$e.a(TextInputChannel.java:6)
at oa.s$a.onMethodCall(TextInputChannel.java:43)
at pa.k$a.a(MethodChannel.java:2)
at da.c.l(DartMessenger.java:2)
at da.c.m(DartMessenger.java:4)
at da.c.g(Unknown Source:0)
at da.b.run(Unknown Source:12)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:8919)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
)
Steps to Reproduce
Expected results: Nothing special happens.
Actual results: Application throws exception.
Code sample
```dart class MyApp extends StatelessWidget { const MyApp({Key? key}) : super(key: key); @override Widget build(BuildContext context) { return MaterialApp( home: Material( child: Padding( padding: EdgeInsets.all(50.0), child: TextField(), ), ), ); } } ```Logs
``` E/MethodChannel#flutter/textinput( 9756): Failed to handle method call E/MethodChannel#flutter/textinput( 9756): java.lang.IndexOutOfBoundsException: invalid selection end: 4 E/MethodChannel#flutter/textinput( 9756): at io.flutter.embedding.engine.systemchannels.TextInputChannel$TextEditState.