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

Closed
flutter-team-archive/engine
#34508

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

Activity

  1. rd-wang commented on Jul 1, 2022

    @rd-wang
    Author
    normal.video.mp4
  2. rd-wang commented on Jul 1, 2022

    @rd-wang
    Author

    TextField has same error

  3. darshankawar commented on Jul 1, 2022

    @darshankawar
    Member
    1. i use the sougou input(搜狗输入法) input emoji)

    @rd-wang Is this a separate virtual keyboard ? Is the behavior replicable if you use chinese simplified language from phone settings ?

  4. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 1, 2022
  5. rd-wang commented on Jul 4, 2022

    @rd-wang
    Author
  6. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 4, 2022
  7. darshankawar commented on Jul 4, 2022

    @darshankawar
    Member

    @rd-wang Thanks for the update. There was a similar issue reported and was fixed #80192
    Can you try the same using latest master and see if error still persists ?

  8. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 4, 2022
  9. rd-wang commented on Jul 6, 2022

    @rd-wang
    Author

    i try the version stable 3.0.4 error still persists
    It's not the same problem #80192
    i find the same error on #100891

    flutter doctor                                    5s 10:16:15
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel stable, 3.0.4, 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 (3 available)
    [✓] HTTP Host Availability
    
  10. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 6, 2022
  11. darshankawar commented on Jul 6, 2022

    @darshankawar
  12. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 6, 2022
  13. rd-wang commented on Jul 6, 2022

    @rd-wang
    Author
  14. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jul 6, 2022
  15. 8 remaining items

  16. added
    c: fatal crashCrashes that terminate the process
    engineflutter/engine related. See also e: labels.
    platform-iosiOS applications specifically
    and removed
    in triagePresently being triaged by the triage team
    on Jul 8, 2022
  17. changed the title [-]Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid JSON message, encoding failed'[/-] [+][ios]: Trying to delete emoji crashes the app and throws `Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid JSON message, encoding failed'` error[/+] on Jul 8, 2022
  18. rd-wang commented on Jul 8, 2022

    @rd-wang
    Author

    Glad to hear the crash was replicated and resolved
    thanks

  19. jmagman commented on Jul 25, 2022

    @jmagman
    Member
  20. added
    r: fixedIssue is closed as already fixed in a newer version
    on Jul 26, 2022
  21. github-actions commented on Aug 9, 2022

    @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.

  22. locked as resolved and limited conversation to collaborators on Aug 9, 2022
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

    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