Skip to content

[ios]: Trying to delete emoji crashes the app and throws Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid JSON message, encoding failed' error #106933

@rd-wang

Description

@rd-wang
Successfully load keyboard extensions
*** Assertion failure in -[FlutterJSONMessageCodec encode:], FlutterCodecs.mm:79
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid JSON message, encoding failed'
*** First throw call stack:
(0x18a659288 0x1a3353744 0x18bee6360 0x106697688 0x1066979ec 0x10669684c 0x10614ffdc 0x10616596c 0x18d557478 0x18d79d3e4 0x18d79cf0c 0x18d793308 0x18d7930d8 0x18d78eadc 0x18d7ba940 0x18cfd965c 0x18ce86304 0x18bdf1f20 0x18a67b414 0x18a68c1a0 0x18a5c5694 0x18a5cb05c 0x18a5debc8 0x1a6712374 0x18cf4e648 0x18cccfd90 0x1023cc93c 0x102a85ce4)
libc++abi: terminating with uncaught exception of type NSException
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
    frame #0: 0x00000001c2095b38 libsystem_kernel.dylib`__pthread_kill + 8
libsystem_kernel.dylib`__pthread_kill:
->  0x1c2095b38 <+8>:  b.lo   0x1c2095b58               ; <+40>
    0x1c2095b3c <+12>: pacibsp 
    0x1c2095b40 <+16>: stp    x29, x30, [sp, #-0x10]!
    0x1c2095b44 <+20>: mov    x29, sp
Target 0: (Runner) stopped.
Lost connection to device.

Steps to Reproduce

  1. when use the TextFormField widget delete Emoji (i use the sougou input(搜狗输入法) input emoji)
  2. crash happened on iPhone11 ios15.5

Expected results:

Actual results:

Code sample
TextFormField(
                      style: TextStyle(color: Color(0xff1E1E1E)),
                      enableInteractiveSelection: false,
                      keyboardType: TextInputType.number,
                      controller: _nameController,
                      inputFormatters: [LengthLimitingTextInputFormatter(11)],
                      decoration: InputDecoration(
                        hintText: S.of(context).desc_input_phone_number_hint,
                        hintStyle: TextStyle(color: Color(0xffA8B2C2)),
                        border: InputBorder.none,
                        enabledBorder: InputBorder.none,
                      ),
                    ),
Logs
 flutter doctor                                      36s 11:16:21

┌─────────────────────────────────────────────────────────┐
│ A new version of Flutter is available!                  │
│                                                         │
│ To update to the latest version, run "flutter upgrade". │
└─────────────────────────────────────────────────────────┘
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.0.2, on macOS 12.2.1 21D62 darwin-arm, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc2)
[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2021.2)
[✓] Connected device (4 available)
[✓] HTTP Host Availability

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: text inputEntering text in a text field or keyboard related problemsc: fatal crashCrashes that terminate the processengineflutter/engine related. See also e: labels.found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionwaiting for PR to land (fixed)A fix is in flight

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions