-
Notifications
You must be signed in to change notification settings - Fork 28.7k
Crash while type some characters and double click in textfield: 'NSInternalInconsistencyException', 8000 reason: 'Expected a valid text range.' #138464
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
Comments
Thanks for filing this @randomhuangpl. RPReplay_Final1700038972.MP4Can you please share your device information and the full output of your flutter doctor -v
|
@dam-ease I suspect that because the length of "hdjk" is smaller than "hdjdd," it causes a crash. So, the issue seems to be that when inputting certain characters, if the length of the suggested word is shorter than the original one, it leads to a crash. 20231115-181058.mp4 |
Thanks for your response. I tried these as well but can't reproduce the crash, maybe it could be device-specific, can you also try these steps on an emulator of a different device with the same OS? |
I have information from users of my app with the same problem, but I couldn't reproduce it because I don't have a device with iOS 17+, but I have videos recorded by customers and the same thing happens, when interacting with a textField the app freezes for a few moments and closes in followed. |
I managed to minimize the problem by setting the "autocorrect: false" attribute. Although it's not the best of all worlds, at least the app stopped crashing. |
Thanks for responding @AguinaldoAranda. |
Hello. The problem was reported by a customer, iPhone 11 with iOS 17.1.2 The problem does not happen in my development environment, with an iPhone 11/14 simulator and iOS 16.2. And although the problem is related to inputText, in my case, the app closes when the user presses to use a text suggestion. I noticed that the attr "autocorrect: false," does not disable the suggestions if the attr TextInputType is text, I changed it to TextInputType = name, this way it worked, but very frustrating. Sorry for English. |
Thanks for your response. |
Hello, if I find any more concrete evidence I will return here, we have 2 apps showing this behavior, several reports from customers. |
instead of throwing it looks like our |
Hey I am facing this issue on iOS 17+ device, when AutoCorrect is enabled. And as mention by @AguinaldoAranda the app is freezing and crashing 2 or 3 times initially. I added flags enabledSuggestions and autoCorrect to false but that seems to not working as expected |
I have had success with autocorrect:false when used in conjunction with attr keyboardType: TextInputType.name |
@ankittale , did this solve it? |
Yes Indeed. Thanks |
That behavior was introduced to fix a a11y bug flutter/engine#16496 |
Here is a symbolicated crash log from my app. Flutter version: 3.16.7 Crash log:
Originally posted by @hig-dev in #100891 (comment) |
Here is crash log from our app in production. While using app on iOS, whenever tapped on textfield, app freezes for some time. Flutter Doctor
Crash log
|
Facing same issue here is the video recording and logs...
ios_textfield_crash_issue.mp4 |
A similar crash occurred on my side. When I was typing, I clicked on the input box and it flashed back. [!] Flutter (Channel [user-branch], 3.16.3, on macOS 13.5.1 22G90 darwin-arm64, locale zh-Hans-CN) [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 15.0) [✓] Chrome - develop for the web [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.84.1) [✓] Connected device (4 available) 27_1709885582.mp4 |
Is this fixed on the latest flutter version or still an issue? |
Still seeing this on Flutter 3.24.2 |
This comment was marked as duplicate.
This comment was marked as duplicate.
Flutter 3.24.5 Reproduce on iOS 17.7.2, iPhone 12 mini. |
We regularly receive complaints from users. People are requesting refunds due to a crash that we are unable to fix on our own and an issue that has been open for many months =( |
[Previously approved](flutter/engine#55909) in /engine before monorepo shift. Reverts an unnecessary assertion introduced by [#16496](flutter/engine#16496) that crashes upon valid user text field interactions. Follow-on work can resolve the underlying discrepancy between iOS and Flutter range finding (see #160100). For crash reports, see issue [#138464](#138464). ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md Co-authored-by: Chris Bracken <chris@bracken.jp>
Looks like 3.30.0 will remove the crashing assertion. |
we have the same issue too. Flutter Doctor
Crash Report
|
stilll having this issue. any updates? |
Uh oh!
There was an error while loading. Please reload this page.
Is there an existing issue for this?
Steps to reproduce
work in iOS 17.0.0 well. While update to 17.1.1 crash.
Expected results
no crash
Actual results
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Expected a valid text range.'
*** First throw call stack:
(0x1a277c870 0x19aa97c00 0x1a1ce6d18 0x10af72f54 0x1a5560928 0x1a555ec90 0x1a5557724 0x1a55573ec 0x1a55539ac 0x1a54d37e0 0x1a4bc3c2c 0x1a4bc3b10 0x1a551b738 0x1a54d34a0 0x10af71a78 0x10af79d04 0x10b4fe1c8 0x10af6b590 0x10a678f50 0x10a67ab34 0x10a68afec 0x10a68aba0 0x1a26c720c 0x1a26c3f18 0x1a26c3668 0x1e5a8e5ec 0x1a4ae02b4 0x1a4adf8f0 0x104ae49cc 0x1c5116dcc)
Code sample
Code sample
Screenshots or Video
Screenshots / Video demonstration
20231115-152259.mp4
Logs
Logs
Flutter Doctor output
Doctor output
The text was updated successfully, but these errors were encountered: