Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iOS keyboard enter crash on real phone but not on simulator #36688

Closed
jinfagang opened this issue Jul 22, 2019 · 29 comments

Comments

@jinfagang
Copy link

commented Jul 22, 2019

Simply do something when keyboard submit. On real phone crash, but simulator works fine, iOS side.

@timsneath

This comment has been minimized.

Copy link
Member

commented Jul 22, 2019

Hi there, we need more information to understand what's going on here.

Can you link to some repro code? What version of Flutter are you using (flutter doctor -v)? What do you need to do to get this crash to occur (i.e. what is 'do something' in your context)? What version of iOS are you running on your real phone and what phone model is it?

Thanks!

@jinfagang

This comment has been minimized.

Copy link
Author

commented Jul 23, 2019

My iOS version iOS 13 which is the newest, and flutter is also the newest. I will link a sample code to reproduce but if anyone have run flutter cupertino text input widget and do something inside onSubmit, I think it will crash out.

@pkkhandsome

This comment has been minimized.

Copy link

commented Jul 25, 2019

Ios 13 .
The following two examples can cause the program to crash.
1> When click on the textField with Chinese, or typed Chinese, and click done.
2> Enter an emoji and switch the input type ( Earth button in the lower left corner of the keyboard).

@jinfagang

This comment has been minimized.

Copy link
Author

commented Jul 25, 2019

@pkkhandsome Issue confirmed, I am exactly got this every time on Chinese keyboard.

@timsneath

This comment has been minimized.

Copy link
Member

commented Jul 25, 2019

What version of Flutter specifically? Again, please submit the results of flutter doctor -v. We fixed a crash related to the Chinese keyboard in an update to the stable channel that we posted today.

@pkkhandsome

This comment has been minimized.

Copy link

commented Jul 25, 2019

V 1.7.8 hotfix4 .
I have updated this version this morning.
It does not solve this problem.

@pkkhandsome

This comment has been minimized.

Copy link

commented Jul 25, 2019

[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Mac OS X 10.14.5 18F132, locale zh-Hans-CN)
• Flutter version 1.7.8+hotfix.4 at /Users/poersmart/down_src/flutter
• Framework revision 20e5931 (6 days ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0

[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/setup/#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
You may also want to add it to your PATH environment variable.

[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.2.1, Build version 10E1001
• CocoaPods version 1.7.2

[✓] iOS tools - develop for iOS devices
• ios-deploy 1.9.4

[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/setup/#android-setup for detailed instructions).

[✓] Connected device (1 available)
• KK • 60637fe0b4ca6344e5afb3951df4e29afb728da2 • ios • iOS 13.0

! Doctor found issues in 2 categories.

@timsneath

This comment has been minimized.

Copy link
Member

commented Jul 25, 2019

OK, thanks -- that's really helpful. We'll take a look. Would also like to know if you (or anyone else) is able to reproduce it on the current released version of iOS 12, or whether this is only on iOS 13 beta.

@pkkhandsome

This comment has been minimized.

Copy link

commented Jul 25, 2019

This is normal On IOS12.
Maybe the problem is caused by IOS13 beta. The biggest problem is that I can't see any error messages when it crashes.

@jinfagang

This comment has been minimized.

Copy link
Author

commented Jul 25, 2019

@timsneath iOS 13 beta here, same crash happened. The crash is simply crash without any messages.

@a1154043439

This comment has been minimized.

Copy link

commented Aug 2, 2019

I have same problem, here is my crash log:
Date/Time: 2019-08-02 14:52:41.7374 +0800
Launch Time: 2019-08-02 14:52:32.3373 +0800
OS Version: iPhone OS 13.0 (17A5547d)
Release Type: Beta
Baseband Version: 4.03.04
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x000000027ffffff0
VM Region Info: 0x27ffffff0 is not in any region. Bytes after previous region: 1915322353 Bytes before following region: 16
REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL
unused shlib __TEXT 000000020d146000-000000020dd68000 [ 12.1M] r--/r-- SM=COW ... this process
---> GAP OF 0x72298000 BYTES
MALLOC_NANO 0000000280000000-00000002a0000000 [512.0M] rw-/rwx SM=PRV

Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [2842]
Triggered by Thread: 0

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_platform.dylib 0x00000001bb28da98 _platform_memmove + 408
1 CoreFoundation 0x00000001bb51d07c __CFStringCreateImmutableFunnel3 + 2504
2 CoreFoundation 0x00000001bb520e3c CFStringCreateWithSubstring + 492
3 CoreFoundation 0x00000001bb463728 -[__NSCFString substringWithRange:] + 160
4 UIKitCore 0x00000001bf2266a4 -[TIDocumentState+ 7005860 (UITextInputAdditions) _contextAfterPosition:inDocument:toBoundary:] + 328
5 UIKitCore 0x00000001bf22681c -[TIDocumentState+ 7006236 (UITextInputAdditions) initWithDocument:contextBoundary:] + 268
6 UIKitCore 0x00000001bf225d2c +[TIDocumentState+ 7003436 (UITextInputAdditions) documentStateOfDocument:] + 56
7 UIKitCore 0x00000001bf37e49c -[UIKeyboardImpl syncDocumentStateToInputDelegateWithExecutionContext:] + 1132
8 UIKitCore 0x00000001bf37eb90 -[UIKeyboardImpl updateForChangedSelectionWithExecutionContext:] + 532
9 UIKitCore 0x00000001bf3aee10 -[UIKeyboardTaskEntry execute:] + 180
10 UIKitCore 0x00000001bf3ad840 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 316
11 UIKitCore 0x00000001bf3adb6c -[UIKeyboardTaskQueue performTaskOnMainThread:waitUntilDone:] + 260
12 UIKitCore 0x00000001bf37e958 -[UIKeyboardImpl updateForChangedSelection] + 96
13 UIKitCore 0x00000001bf389dfc -[UIKeyboardImpl addWordTerminator:afterSpace:afterAcceptingCandidate:elapsedTime:executionContext:] + 368
14 UIKitCore 0x00000001bf3881f8 __81-[UIKeyboardImpl addInputString:withFlags:withInputManagerHint:executionContext:]_block_invoke + 60
15 UIKitCore 0x00000001bf3ad258 -[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:] + 120
16 UIKitCore 0x00000001bf38809c -[UIKeyboardImpl addInputString:withFlags:withInputManagerHint:executionContext:] + 512
17 UIKitCore 0x00000001bf39aabc -[UIKeyboardImpl handleKeyWithString:forKeyEvent:executionContext:] + 792
18 UIKitCore 0x00000001bf399af4 -[UIKeyboardImpl _handleKeyEvent:executionContext:] + 484
19 UIKitCore 0x00000001bf2fd2a0 -[UIKeyboardLayoutStar completeRetestForTouchUp:timestamp:interval:executionContext:] + 4996
20 UIKitCore 0x00000001bf3a2b3c __45-[UIKeyboardLayout touchUpTaskForTouchState:]_block_invoke + 232
21 UIKitCore 0x00000001bf3a2da0 __28-[UIKeyboardLayout touchUp:]_block_invoke + 108
22 UIKitCore 0x00000001bf3aee10 -[UIKeyboardTaskEntry execute:] + 180
23 UIKitCore 0x00000001bf3ad840 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 316
24 UIKitCore 0x00000001bf3a2d1c -[UIKeyboardLayout touchUp:] + 316
25 UIKitCore 0x00000001bf3a2884 -[UIKeyboardLayout _touchEndedProcessingForTouches:] + 328
26 UIKitCore 0x00000001bf587dec -[UIWindow _sendTouchesForEvent:] + 2324
27 UIKitCore 0x00000001bf58912c -[UIWindow sendEvent:] + 3352

@zhancheng

This comment has been minimized.

Copy link

commented Aug 3, 2019

same issue.

@Artoria-Huang

This comment has been minimized.

Copy link

commented Aug 6, 2019

same issue on iOS 13 beta5

@uldh

This comment has been minimized.

Copy link

commented Aug 21, 2019

Does this problem fixed?

@jinfagang

This comment has been minimized.

Copy link
Author

commented Aug 21, 2019

Not yet, still same issue after I upgrade flutter yesterday.

@Qxyat

This comment has been minimized.

Copy link

commented Aug 21, 2019

The repair is current on master channel. @uldh @jinfagang , would you please switch to the master channel and confirm if the problem still exists?

@jinfagang

This comment has been minimized.

Copy link
Author

commented Aug 21, 2019

@Qxyat I am just upgrade flutter with flutter upgrade rather than build from source, when will it accessable via flutter upgrade, BTW, the keyboard on iOS with Chinese sometime crash even in typing...

@Qxyat

This comment has been minimized.

Copy link

commented Aug 22, 2019

@jinfagang Can you provide the output of running flutter doctor -v?

@jinfagang

This comment has been minimized.

Copy link
Author

commented Aug 22, 2019

@Qxyat I shall update this night.

@jinfagang

This comment has been minimized.

Copy link
Author

commented Aug 26, 2019

I upgraded flutter yesterday, seems this issue still not fix.

this issue specific happened on Chinese keyboard, English has no problem.

Really hope flutter team can investigate on this issue. Also this crash not only happend when click enter on softkeyboard, but also sometimes crash when click the CupertinoTextField it self.

it seems only happend combined with Chinese keyboard and using CupertinoTextField

@pkkhandsome

This comment has been minimized.

Copy link

commented Aug 26, 2019

I upgraded flutter in master channel . It fixed , seems.
And this channel is not compatible,
You need some minor changes on the code.

@jinfagang

This comment has been minimized.

Copy link
Author

commented Aug 26, 2019

I haven't tried from git master, simply call flutter upgrade. It seems master branch haven't make changes on published upgrade?

@pkkhandsome

This comment has been minimized.

Copy link

commented Aug 26, 2019

flutter channel master

wait for ending.

@jinfagang

This comment has been minimized.

Copy link
Author

commented Aug 26, 2019

@pkkhandsome Thanks, what do u mean channel incompatible? Need change only textfield widget or need lots of changes to all current project codes?

@pkkhandsome

This comment has been minimized.

Copy link

commented Aug 26, 2019

I am not sure how many points to change.
There is some syntax difference between stable and master.
It will report an error when compiling, Similar to :
socket.transform(utf8.decoder).listen((data) {});
and u should fix it like this
socket.listen((data) { String myData = utf8.decode(data); });

It was the problem I encountered.

@a1154043439

This comment has been minimized.

Copy link

commented Aug 27, 2019

@Qxyat would you please show us repair commit's commit-id, thank you~

The repair is current on master channel. @uldh @jinfagang , would you please switch to the master channel and confirm if the problem still exists?

@jinfagang jinfagang closed this Aug 27, 2019
@Qxyat

This comment has been minimized.

Copy link

commented Aug 27, 2019

@a1154043439 cid:e95125aad331155c527abe7d0d062cd977d6c8e3

@a1154043439

This comment has been minimized.

Copy link

commented Aug 28, 2019

Considering that WWDC may release the official version of iOS 13 on September 15, I would like to ask if there is any situation before the September 15,the stable branch of flutter can hot fix the Chinese keyboard crash problem, otherwise we need to upgrade the engine by ourselves to solve this problem? I look forward to your reply @timsneath

@tvolkert

This comment has been minimized.

Copy link
Contributor

commented Aug 29, 2019

FYI, this fix rolled into the framework in cde2784 and exists on the dev channel in versions v1.9.0 and above. Per our release cadence, this should get promoted to the beta channel early next week. @timsneath may be able to comment on our next stable release.

Thanks for the fix @Qxyat!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.