Repository navigation
Failed assertion: line 1017 pos 14: '_dragState == _DragState.possible': is not true. #153458
Copy link
Copy link
Closed
Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: gesturesflutter/packages/flutter/gestures repository.flutter/packages/flutter/gestures repository.found in release: 3.24Found to occur in 3.24Found to occur in 3.24frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Description
Steps to reproduce
- Insert example code in a Flutter App for iOS.
- Debug in an actual device.
- Paste some text into the TextField with more than 5 lines.
- Double-tap to select a word.
- Swipe outside the selection (the word will remain highlighted without the handles).
- Tap on the selected word.
Expected results
TextField should process tap gestures on iOS devices.
Actual results
The text field stops processing the tap gesture and also exhibits erratic and unpredictable behavior after the assert condition occurs.
Code sample
Code sample
const TextField(
maxLines: 5,
)
Screenshots or Video
Screenshots / Video demonstration
[Upload media here]
Logs
Logs
======== Exception caught by gesture library =======================================================
The following assertion was thrown while dispatching a pointer event:
'package:flutter/src/gestures/tap_and_drag.dart': Failed assertion: line 1017 pos 14: '_dragState == _DragState.possible': is not true.
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=2_bug.yml
When the exception was thrown, this was the stack:
#2 BaseTapAndDragGestureRecognizer.acceptGesture (package:flutter/src/gestures/tap_and_drag.dart:1017:14)
#3 GestureArenaManager.sweep (package:flutter/src/gestures/arena.dart:169:27)
#4 GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:505:20)
#5 GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:481:22)
#6 RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:450:11)
#7 GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:426:7)
#8 GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:389:5)
#9 GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:336:7)
#10 GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:305:9)
#11 _invoke1 (dart:ui/hooks.dart:328:13)
#12 PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:442:7)
#13 _dispatchPointerDataPacket (dart:ui/hooks.dart:262:31)
(elided 2 frames from class _AssertionError)
Event: PointerUpEvent#2585a(position: Offset(155.3, 331.0))
position: Offset(155.3, 331.0)
Target: <WidgetsFlutterBinding>
====================================================================================================Flutter Doctor output
Doctor output
[!] Flutter (Channel stable, 3.24.0, on macOS 14.5 23F79 darwin-arm64, locale en-ES)
• Flutter version 3.24.0 on channel stable at /users/siddhartha/development/flutter
! Warning: `flutter` on your path resolves to /Users/siddhartha/Development/flutter/bin/flutter, which is not inside your current Flutter SDK checkout at /users/siddhartha/development/flutter.
Consider adding /users/siddhartha/development/flutter/bin to the front of your path.
! Warning: `dart` on your path resolves to /Users/siddhartha/Development/flutter/bin/dart, which is not inside your current Flutter SDK checkout at /users/siddhartha/development/flutter.
Consider adding /users/siddhartha/development/flutter/bin to the front of your path.
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 80c2e84975 (2 weeks ago), 2024-07-30 23:06:49 +0700
• Engine revision b8800d88be
• Dart version 3.5.0
• DevTools version 2.37.2
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
• Android SDK at /Users/siddhartha/Library/Android/sdk
• Platform android-34, build-tools 34.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15F31d
• CocoaPods version 1.15.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.2)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874)
[✓] IntelliJ IDEA Community Edition (version 2024.1.6)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 81.0.2
• Dart plugin version 241.18968.26
[✓] VS Code (version 1.92.0)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.94.0
[✓] Connected device (7 available)
• Pixel 6a (mobile) • 29261JEGR09487 • android-arm64 • Android 14 (API 34)
• CPH2161 (mobile) • NF6HPBY98LXGHM99 • android-arm64 • Android 12 (API 31)
• iPhone de Dante (mobile) • 00008120-00062D983CC0C01E • ios • iOS 18.0 22A5338b
• iPhone 15 Pro Max (mobile) • 905EEE9E-8306-4379-9F60-3E96872FC350 • ios • com.apple.CoreSimulator.SimRuntime.iOS-17-4 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 14.5 23F79 darwin-arm64
• Mac Designed for iPad (desktop) • mac-designed-for-ipad • darwin • macOS 14.5 23F79 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 127.0.6533.100
! Error: Browsing on the local area network for iPhone 14 de Ryo . Ensure the device is unlocked and attached with a cable or associated with the same local area network as this Mac.
The device must be opted into Developer Mode to connect wirelessly. (code -27)
[✓] Network resources
• All expected network resources are available.
! Doctor found issues in 1 category.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: error messageError messages from the Flutter frameworkError messages from the Flutter frameworka: text inputEntering text in a text field or keyboard related problemsEntering text in a text field or keyboard related problemsf: gesturesflutter/packages/flutter/gestures repository.flutter/packages/flutter/gestures repository.found in release: 3.24Found to occur in 3.24Found to occur in 3.24frameworkflutter/packages/flutter repository. See also f: labels.flutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-text-inputOwned by Text Input teamOwned by Text Input teamtriaged-text-inputTriaged by Text Input teamTriaged by Text Input team
Activity
huycozy commentedon Aug 15, 2024
Thanks for the report, @siddharthadevops
I can reproduce this issue on Flutter stable 3.24.0 but don't see it appear on master channel
3.24.0-1.0.pre.591. Can you please confirm this on master channel on your end?siddharthadevops commentedon Aug 15, 2024
@huycozy yes, I have been able to reproduce this bug also on master channel:
huycozy commentedon Aug 16, 2024
Can you take a look at my demo video to see if I missed any steps to reproduce this error? I'm on the latest master
3.24.0-1.0.pre.605.Demo
Screen.Recording.2024-08-16.at.11.57.43.mov
siddharthadevops commentedon Aug 16, 2024
Sorry @huycozy, I didn't have the master channel updated to the latest version. I thought I had updated it along with the stable version.
Once updated, I have not been able to reproduce this bug in the master channel.
huycozy commentedon Aug 16, 2024
Thank you for confirming this. Closing this as fixed on master channel.
Adam-Langley commentedon Aug 21, 2024
Thanks @huycozy - is there documentation on how I can determine when this is likely to land in stable? This one is biting our power users - they swipe about so quickly in our app, this bug is triggered often, rendering the UI unusable - so I'd like to be able to at minimum give them a timeline to resolution.
siddharthadevops commentedon Aug 21, 2024
I think this issue should be prioritized. Every time the user tries to edit a text by selecting, cutting, pasting, etc., it is highly likely that this error will occur.
5 remaining items
Renzo-Olivares commentedon Aug 21, 2024
@huycozy Thanks for letting me know, I'll try to CP this in.
[CP-stable] Fix BaseTapAndDragGestureRecognizer should reset drag sta…
Renzo-Olivares commentedon Sep 30, 2024
Closing this because the cherry-pick was merged into stable #153935.
github-actions commentedon Oct 15, 2024
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 -vand a minimal reproduction of the issue.