Skip to content

Failed assertion: line 1017 pos 14: '_dragState == _DragState.possible': is not true. #153458

@siddharthadevops

Description

@siddharthadevops

Steps to reproduce

  1. Insert example code in a Flutter App for iOS.
  2. Debug in an actual device.
  3. Paste some text into the TextField with more than 5 lines.
  4. Double-tap to select a word.
  5. Swipe outside the selection (the word will remain highlighted without the handles).
  6. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: error messageError messages from the Flutter frameworka: text inputEntering text in a text field or keyboard related problemsf: gesturesflutter/packages/flutter/gestures repository.found in release: 3.24Found to occur in 3.24frameworkflutter/packages/flutter repository. See also f: labels.has 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 versionteam-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions