Skip to content

Flutter iOS 12.0 textfield crash with CJK input method #22201

@HipSze

Description

@HipSze

Steps to Reproduce

  1. Create two textfields

  2. Select some characters in Chinese( Chinese(Traditional) - Cangjie) keyboard in the first textfield, then select the second textfield without choosing a Chinese character from the prediction.
    Here is the example image:
    https://www.dropbox.com/s/gt540b5188egfvp/1.png?dl=0

  3. the app will crash (only in iOS 12.0, it would not crash in iOS 11.4)

Flutter console show:

*** First throw call stack:
(
0   CoreFoundation                      0x000000010b12029b __exceptionPreprocess + 331
1   libobjc.A.dylib                     0x000000010a6c4735 objc_exception_throw + 48
2   CoreFoundation                      0x000000010b1200f5 +[NSException raise:format:] + 197
3   CoreFoundation                      0x000000010b0666e3 -[__NSCFString substringWithRange:] + 163
4   UIKitCore                           0x000000011497fb5a -[UIKeyboardImpl hasMarkedText] + 143
5   UIKitCore                           0x000000011496f3a8 __43-[UIKeyboardImpl generateAutofillCandidate]_block_invoke + 51
6   UIKitCore                           0x00000001149da9bf -[UIKeyboardTaskEntry execute:] + 169
7   UIKitCore                           0x00000001149d91ae -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 374
8   UIKitCore  <…>
Lost connection to device.
Exited (sigterm)

Xcode console show:

2018-09-24 12:47:07.185255+0800 Runner[278:28523] *** Terminating app due to uncaught exception 'NSRangeException', reason: '-[__NSCFString substringWithRange:]: Range {0, 3} out of bounds; string length 0'
*** First throw call stack:
(0x1b4ccbf78 0x1b3ec4284 0x1b4bcc75c 0x1b4bba278 0x1e1e1abe0 0x1e1e09b94 0x1e1e77124 0x1e1e7574c 0x1e1e76174 0x1e1e09b44 0x1e1e1c3c8 0x105abe944 0x105abfe38 0x105ab2fa8 0x105acd628 0x105acf25c 0x105b1ee24 0x105adca88 0x105adf8c8 0x1b4c590a4 0x1b4c58dd0 0x1b4c585c4 0x1b4c53284 0x1b4c52844 0x1b6f01be8 0x1e2001428 0x104445cb4 0x1b4708020)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb) 

Logs

Analyzing ctm...

   info • Unused import: 'package:geocoder/geocoder.dart' • lib/drawerPage/location_page.dart:5:8 • unused_import
   info • The value of the local variable '_isLoggin' isn't used • lib/login.dart:67:10 • unused_local_variable

2 issues found. (ran in 1.7s)
[✓] Flutter (Channel beta, v0.8.2, on Mac OS X 10.13.6 17G2307, locale en-HK)
    • Flutter version 0.8.2 at /Users/kenwong/Development/flutter
    • Framework revision 5ab9e70727 (2 weeks ago), 2018-09-07 12:33:05 -0700
    • Engine revision 58a1894a1c
    • Dart version 2.1.0-dev.3.1.flutter-760a9690c2

[✓] Android toolchain - develop for Android devices (Android SDK 28.0.1)
    • Android SDK at /Users/kenwong/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
    • All Android licenses accepted.

[✓] iOS toolchain - develop for iOS devices (Xcode 10.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.0, Build version 10A255
    • ios-deploy 1.9.2
    • CocoaPods version 1.5.3

[✓] Android Studio (version 3.1)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 27.1.1
    • Dart plugin version 173.4700
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 26.0.3
    • Dart plugin version 182.3569.4

[✓] VS Code (version 1.27.2)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 2.18.0

[✓] Connected devices (1 available)
    • iPhone XS Max • B3E2C057-F13D-4916-A3CE-D8D0BE924DC5 • ios • iOS 12.0 (simulator)

• No issues found!

Metadata

Metadata

Assignees

Labels

a: internationalizationSupporting other languages or locales. (aka i18n)a: text inputEntering text in a text field or keyboard related problemsc: crashStack traces logged to the consoleengineflutter/engine related. See also e: labels.platform-iosiOS applications specifically

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions