Skip to content

'package:flutter/src/rendering/mouse_tracking.dart': Failed assertion: line 311 pos 12: '!_debugDuringDeviceUpdate': is not true. #76325

Closed

Description

@tiloc

Steps to Reproduce

I have been asked by flutter to file an issue:
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.md

This randomly occurred once during startup of my application on macOS.

[ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: 'package:flutter/src/rendering/mouse_tracking.dart': Failed assertion: line 423 pos 18: 'event is! PointerRemovedEvent': is not true.
#0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:46:39)
#1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
#2      BaseMouseTracker.updateWithEvent.<anonymous closure>.<anonymous closure> (package:flutter/src/rendering/mouse_tracking.dart:423:18)
#3      BaseMouseTracker._deviceUpdatePhase (package:flutter/src/rendering/mouse_tracking.dart:316:9)
#4      BaseMouseTracker.updateWithEvent.<anonymous closure> (package:flutter/src/rendering/mouse_tracking.dart:418:7)
#5      BaseMouseTracker._monitorMouseConnection (package:flutter/src/rendering/mouse_tracking.dart:300:9)
#6      BaseMouseTracker.updateWithEvent (package:flutter/src/rendering/mouse_tracking.dart:417:5)
#7      RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:275:22)
#8      GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:316:7)
#9      GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:280:5)
#10     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:238:7)
#11     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:221:7)
#12     _rootRunUnary (dart:async/zone.dart:1370:13)
#13     _CustomZone.runUnary (dart:async/zone.dart:1265:19)
#14     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
#15     _invoke1 (dart:ui/hooks.dart:186:10)
#16     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:282:7)
#17     _dispatchPointerDataPacket (dart:ui/hooks.dart:96:31)


======== Exception caught by scheduler library =====================================================
The following assertion was thrown during a scheduler callback:
'package:flutter/src/rendering/mouse_tracking.dart': Failed assertion: line 311 pos 12: '!_debugDuringDeviceUpdate': is not true.

When the exception was thrown, this was the stack: 
#2      BaseMouseTracker._deviceUpdatePhase (package:flutter/src/rendering/mouse_tracking.dart:311:12)
#3      BaseMouseTracker.updateAllDevices (package:flutter/src/rendering/mouse_tracking.dart:460:5)
#4      RendererBinding._scheduleMouseTrackerUpdate.<anonymous closure> (package:flutter/src/rendering/binding.dart:336:22)
#5      SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1144:15)
#6      SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1090:9)
flutter doctor -v
[✓] Flutter (Channel dev, 1.27.0-1.0.pre, on macOS 11.2.1 20D74 darwin-arm, locale en-DE)
    • Flutter version 1.27.0-1.0.pre at /Users/tilo/development/flutter
    • Framework revision 68c96f100e (10 days ago), 2021-02-08 16:14:15 -0800
    • Engine revision b04955656c
    • Dart version 2.13.0 (build 2.13.0-0.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    • Android SDK at /Users/tilo/Library/Android/sdk
    • Platform android-30, build-tools 30.0.3
    • ANDROID_SDK_ROOT = /Users/tilo/Library/Android/sdk
    • Java binary at: /Library/Java/JavaVirtualMachines/zulu-15.jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment Zulu15.29+15-CA (build 15.0.2+7)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 12.4, Build version 12D4e
    • CocoaPods version 1.10.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

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

[✓] IntelliJ IDEA Community Edition (version 2020.3.2)
    • IntelliJ at /Applications/IntelliJ IDEA CE.app
    • Flutter plugin version 53.1.5
    • Dart plugin version 203.6912

[✓] Connected device (3 available)
    • Pixel 5 (mobile) • 08081FDD4002T6 • android-arm64  • Android 11 (API 30)
    • macOS (desktop)  • macos          • darwin-arm64   • macOS 11.2.1 20D74 darwin-arm
    • Chrome (web)     • chrome         • web-javascript • Google Chrome 88.0.4324.182

! Doctor found issues in 1 category.

Activity

  1. darshankawar commented on Feb 19, 2021

    @darshankawar
    Member

    Hi @tiloc
    Can you provide a reproducible code sample that may trigger this issue ? Does it only occur during app launch or while interacting with the app too ?

  2. darshankawar commented on Feb 19, 2021

    @darshankawar
    Member

    Similar but closed #64129

  3. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 19, 2021
  4. tiloc commented on Feb 19, 2021

    @tiloc
    Author

    Unfortunately no. I came across this once so far and filed this report as the error message from Flutter kindly asked me to.

  5. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 19, 2021
  6. darshankawar commented on Feb 22, 2021

    @darshankawar
    Member

    @tiloc
    I tried a sample app on latest dev in desktop macOS, but didn't observe that issue. So it'll be tough to identify the root-cause as why you saw that error. If possible, try to see if you get same error again and provide the steps to replicate, so that we can properly address this issue.

    flutter doctor -v
    [✓] Flutter (Channel dev, 1.27.0-4.0.pre, on Mac OS X 10.15.4 19E2269
        darwin-x64, locale en-IN)
        • Flutter version 1.27.0-4.0.pre at /Users/dhs/documents/Fluttersdk/flutter
        • Framework revision f8cd24de95 (5 days ago), 2021-02-16 11:24:17 -0800
        • Engine revision 1d537824d6
        • Dart version 2.13.0 (build 2.13.0-30.0.dev)
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.0)
        • Android SDK at /Users/dhs/Library/Android/sdk
        • Platform android-30, build-tools 30.0.0
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build
          1.8.0_242-release-1644-b3-6915495)
        • All Android licenses accepted.
    
    [!] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.3, Build version 12C33
        ! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
            CocoaPods is used to retrieve the iOS and macOS platform side's plugin
            code that responds to your plugin usage on the Dart side.
            Without CocoaPods, plugins will not work on iOS or macOS.
            For more info, see https://flutter.dev/platform-plugins
          To upgrade see
          https://guides.cocoapods.org/using/getting-started.html#installation for
          instructions.
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.1)
        • 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
          1.8.0_242-release-1644-b3-6915495)
    
    [✓] VS Code (version 1.53.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.18.1
    
    [✓] Connected device (3 available)
        • SM A260G (mobile) • 5200763ebcfa861f • android-arm    • Android 8.1.0 (API
          27)
        • macOS (desktop)   • macos            • darwin-x64     • Mac OS X 10.15.4
          19E2269 darwin-x64
        • Chrome (web)      • chrome           • web-javascript • Google Chrome
          88.0.4324.182
    
    ! Doctor found issues in 1 category.
    
    
    
  7. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Feb 22, 2021
  8. Ephenodrom commented on Mar 5, 2021

    @Ephenodrom

    I have the same error on Linux. This seems to appear after nother error is thrown by Flutter. For example once a layout error comes up after that there are a lot of this console outputs :

    [ERROR:flutter/lib/ui/ui_dart_state.cc(186)] Unhandled Exception: 'package:flutter/src/rendering/mouse_tracking.dart': Failed assertion: line 311 pos 12: '!_debugDuringDeviceUpdate': is not true.
    

    Flutter Doctor:

    [✓] Flutter (Channel stable, 2.0.0, on Linux, locale de_DE.UTF-8)
        • Flutter version 2.0.0 at /home/daniel/Flutter
        • Framework revision 60bd88df91 (vor 2 Tagen), 2021-03-03 09:13:17 -0800
        • Engine revision 40441def69
        • Dart version 2.12.0
    
    [!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
        • Android SDK at /home/daniel/Android/Sdk
        • Platform android-29, build-tools 28.0.3
        • Java binary at: /usr/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.9.1+1-Ubuntu-0ubuntu1.18.04)
        • All Android licenses accepted.
    
    [✓] Chrome - develop for the web
        • Chrome at google-chrome
    
    [✓] Linux toolchain - develop for Linux desktop
        • clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
        • cmake version 3.10.2
        • ninja version 1.8.2
        • pkg-config version 0.29.1
    
    [!] Android Studio (not installed)
        • Android Studio not found; download from https://developer.android.com/studio/index.html
          (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
    
    [✓] VS Code (version 1.51.1)
        • VS Code at /usr/share/code
        • Flutter extension version 3.17.0
    
    [✓] Connected device (2 available)
        • Linux (desktop) • linux  • linux-x64      • Linux
        • Chrome (web)    • chrome • web-javascript • Google Chrome 87.0.4280.66
    
    
    
  9. themisir commented on Mar 25, 2021

    @themisir

    I had same issue.

    $ flutter doctor -v
    [✓] Flutter (Channel stable, 2.0.0, on macOS 11.2.3 20D91 darwin-x64, locale en-US)
        • Flutter version 2.0.0 at /Users/misir/Workspace/tools/flutter
        • Framework revision 60bd88df91 (3 weeks ago), 2021-03-03 09:13:17 -0800
        • Engine revision 40441def69
        • Dart version 2.12.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
        • Android SDK at /Users/misir/Library/Android/sdk
        • Platform android-30, build-tools 30.0.3
        • ANDROID_HOME = /Users/misir/Library/Android/sdk
        • ANDROID_SDK_ROOT = /Users/misir/Library/Android/sdk
        • Java binary at: /Applications/Android
          Studio.app/Contents/jre/jdk/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 1.8.0_242-release-1644-b3-6915495)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 12.4, Build version 12D4e
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
    
    [✓] Android Studio (version 4.1)
        • 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 1.8.0_242-release-1644-b3-6915495)
    
    [✓] VS Code (version 1.54.3)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.20.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 11.2.3 20D91 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Google Chrome 89.0.4389.90
    
    • No issues found!
    
  10. no-response commented on Mar 25, 2021

    @no-response

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. Please don't hesitate to comment on the bug if you have any more information for us; we will reopen it right away!
    Thanks for your contribution.

  11. darshankawar commented on Mar 25, 2021

    @darshankawar
    Member

    @Ephenodrom @themisir It'll be great if either of you could provide a reproducible use case that we can use to verify this issue.
    Thanks.

  12. added
    r: timeoutIssue is closed due to author not providing the requested details in time
    and removed
    in triagePresently being triaged by the triage team
    on Mar 25, 2021
  13. 1 remaining item

  14. themisir commented on Mar 25, 2021

    @themisir

    @Ephenodrom @themisir It'll be great if either of you could provide a reproducible use case that we can use to verify this issue.
    Thanks.

    I'm sorry but I can't. I don't know the source of the issue or how to reproduce it. Also after hot restarting the app the issue went away. I just went here to check if there's a solution or not, because if it fixed randomly it will occur randomly again.

  15. jahwill commented on Apr 28, 2021

    @jahwill

    I have same issue also and i notice it only displays the error when I try interact with the app using clickable buttons or widgets with "onTap" functions .
    the following error "type 'KeepAliveNotification' is not a subtype of type 'bool' " is displayed too.
    this happen since i upgraded to null safety.

  16. mustafahawari commented on Jun 9, 2021

    @mustafahawari

    Dealing with same problem since 2 days hope it gets fixed soon

  17. pranavo72bex commented on Jun 30, 2021

    @pranavo72bex
    Contributor

    it still not fixed? I am facing the same problem

  18. noxasch commented on Jul 4, 2021

    @noxasch

    Steps to reproduce:
    Run a flutter desktop app via VSCode "run and debug" and it will throw the error.

    I cannot reproduce this via flutter run. perhaps this is plugin issue.

    VSCode plugin:
    Flutter v3.22.0
    Dart v3.22.0

  19. pranavo72bex commented on Jul 7, 2021

    @pranavo72bex
    Contributor

    WidgetsFlutterBinding.ensureInitialized(); adding this solve my problem

  20. rydmike commented on Jul 24, 2021

    @rydmike
    Contributor

    Just dropping a note to say that I have also seen this exact same error on Widows desktop builds. And I have
    WidgetsFlutterBinding.ensureInitialized() included at the start of the app and it does not help.

    I have not tracked down when and how the error occurs yet. If I find out some more details I will add additional info.

  21. jonataslaw commented on Jul 27, 2021

    @jonataslaw

    Same error on mac.

  22. jnelle commented on Aug 8, 2021

    @jnelle

    I faced the same issue with PaginatedDataTable. Here's my Code:
    https://paste.ubuntu.com/p/69kFSdRWCW/
    @darshankawar

  23. darshankawar commented on Aug 9, 2021

    @darshankawar
    Member

    @Billaids thanks for the code sample, but I see it has 3rd party plugin. We'll need a complete minimal code sample without any 3rd party plugins, that we can directly use to verify this issue.
    Everyone in this thread, it'll be of great help if you could provide us a working code sample without any 3rd party plugins, to make this issue actionable.
    Thanks.

  24. jnelle commented on Aug 9, 2021

    @jnelle

    @darshankawar it's only riverpod provider which returns a list of DataRows.

    https://paste.ubuntu.com/p/Qwy2YvYsP6/

  25. jagadishnallappa commented on Aug 15, 2021

    @jagadishnallappa

    For future readers, This answer worked for me.

    https://stackoverflow.com/a/68637743/6119770

  26. frankbelltower commented on Aug 20, 2021

    @frankbelltower

    Hi everyone, I solved the problem setting shrinkWrap: true

  27. github-actions commented on Sep 3, 2021

    @github-actions

    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 -v and a minimal reproduction of the issue.

  28. locked as resolved and limited conversation to collaborators on Sep 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: timeoutIssue is closed due to author not providing the requested details in time

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions