Skip to content

Mouse Tracker throw error on Desktop(macos) #96364

Closed

Description

@elham-rababah

Mouse Tracker throw error

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: 'package:flutter/src/rendering/mouse_tracker.dart': Failed assertion: line 201 pos 12: '!_debugDuringDeviceUpdate': is not true.
#0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:47:61)
#1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
#2 MouseTracker._deviceUpdatePhase (package:flutter/src/rendering/mouse_tracker.dart:201:12)
#3 MouseTrac

image

Activity

  1. darshankawar commented on Jan 10, 2022

    @darshankawar
    Member

    @elham-rababah
    What flutter version are you on ? A similar issue was reported but wasn't replicable on latest beta and master (#94695 (comment)), so I suggest you to upgrade to their latest version and confirm if this behavior still occurs.

  2. added
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 10, 2022
  3. elham-rababah commented on Jan 10, 2022

    @elham-rababah
    Author

    Fix By adding this WidgetsFlutterBinding.ensureInitialized(); to the main function inside main file.

  4. removed
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    on Jan 10, 2022
  5. added
    r: solvedIssue is closed as solved
    and removed
    in triagePresently being triaged by the triage team
    on Jan 11, 2022
  6. elham-rababah commented on Jan 13, 2022

    @elham-rababah
    Author

    it happed again and the WidgetsFlutterBinding.ensureInitialized(); not solved the issue.

  7. added
    in triagePresently being triaged by the triage team
    waiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds
    and removed
    r: solvedIssue is closed as solved
    on Jan 13, 2022
  8. efreibe commented on Jan 22, 2022

    @efreibe

    It is happening to me as well. I could not find the cause, it happens randomly when switching windows.

    ════════ Exception caught by scheduler library ═════════════════════════════════
    'package:flutter/src/rendering/mouse_tracker.dart': Failed assertion: line 201 pos 12: '!_debugDuringDeviceUpdate': is not true.
    package:flutter/…/rendering/mouse_tracker.dart:1
    ════════════════════════════════════════════════════════════════════════════════
    [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: 'package:flutter/src/rendering/mouse_tracker.dart': Failed assertion: line 201 pos 12: '!_debugDuringDeviceUpdate': is not true.
    package:flutter/…/rendering/mouse_tracker.dart:1
    #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:47:61)
    #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:36:5)
    #2      MouseTracker._deviceUpdatePhase
    package:flutter/…/rendering/mouse_tracker.dart:201
    #3      MouseTracker.updateWithEvent.<anonymous closure>
    package:flutter/…/rendering/mouse_tracker.dart:312
    #4      MouseTracker._monitorMouseConnection
    package:flutter/…/rendering/mouse_tracker.dart:190
    #5      MouseTracker.updateWithEvent
    package:flutter/…/rendering/mouse_tracker.dart:311
    #6      RendererBinding.dispatchEvent
    package:flutter/…/rendering/binding.dart:314
    #7      GestureBinding._handlePointerEventImmediately
    package:flutter/…/gestures/binding.dart:374
    #8      GestureBinding.handlePointerEvent
    package:flutter/…/gestures/binding.dart:338
    #9      GestureBinding._flushPointerEventQueue
    package:flutter/…/gestures/binding.dart:296
    #10     GestureBinding._handlePointerDataPacket
    package:flutter/…/gestures/binding.dart:279
    #11     _rootRunUnary (dart:async/zone.dart:1444:13)
    #12     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
    #13     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
    #14     _invoke1 (dart:ui/hooks.dart:169:10)
    #15     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:293:7)
    #16     _dispatchPointerDataPacket (dart:ui/hooks.dart:88:31)
    
    flutter doctor -v
    [✓] Flutter (Channel stable, 2.8.1, on macOS 12.1 21C52 darwin-x64, locale en-AR)
        • Flutter version 2.8.1 at /Users/ernestofreiberg/flutter
        • Upstream repository https://github.com/flutter/flutter.git
        • Framework revision 77d935af4d (5 weeks ago), 2021-12-16 08:37:33 -0800
        • Engine revision 890a5fca2e
        • Dart version 2.15.1
    
    [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
        • Android SDK at /Users/ernestofreiberg/Library/Android/sdk
        • Platform android-31, build-tools 31.0.0
        • ANDROID_SDK_ROOT = /Users/ernestofreiberg/Library/Android/sdk
        • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
        • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7281165)
        • All Android licenses accepted.
    
    [✓] Xcode - develop for iOS and macOS (Xcode 13.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • CocoaPods version 1.10.1
    
    [✓] Chrome - develop for the web
        • CHROME_EXECUTABLE = /Applications/Brave Browser 2.app/Contents/MacOS/Brave Browser
    
    [✓] Android Studio (version 2020.3)
        • 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 11.0.10+0-b96-7281165)
    
    [✓] VS Code (version 1.63.2)
        • VS Code at /Applications/Visual Studio Code.app/Contents
        • Flutter extension version 3.32.0
    
    [✓] Connected device (2 available)
        • macOS (desktop) • macos  • darwin-x64     • macOS 12.1 21C52 darwin-x64
        • Chrome (web)    • chrome • web-javascript • Brave Browser 97.1.34.80
    
    • No issues found!
    
  9. cbracken commented on Jan 24, 2022

    @cbracken
    Member

    I'm seeing something very similar on Linux, with the following stack trace:

    [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: 'package:flutter/src/rendering/mouse_tracker.dart': Failed assertion: line 201 pos 12: '!_debugDuringDeviceUpdate': is not true.
    #0      _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
    #1      _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
    #2      MouseTracker._deviceUpdatePhase (package:flutter/src/rendering/mouse_tracker.dart:201:12)
    #3      MouseTracker.updateWithEvent.<anonymous closure> (package:flutter/src/rendering/mouse_tracker.dart:312:7)
    #4      MouseTracker._monitorMouseConnection (package:flutter/src/rendering/mouse_tracker.dart:190:9)
    #5      MouseTracker.updateWithEvent (package:flutter/src/rendering/mouse_tracker.dart:311:5)
    #6      RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:314:20)
    #7      GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:374:7)
    #8      GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:338:5)
    #9      GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:296:7)
    #10     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:279:7)
    #11     _rootRunUnary (dart:async/zone.dart:1442:13)
    #12     _CustomZone.runUnary (dart:async/zone.dart:1335:19)
    #13     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1244:7)
    #14     _invoke1 (dart:ui/hooks.dart:170:10)
    #15     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:331:7)
    #16     _dispatchPointerDataPacket (dart:ui/hooks.dart:94:31)
    

    /cc @dkwingsmt who may have the most knowledge of this bit of the code.

  10. dkwingsmt commented on Jan 24, 2022

    @dkwingsmt
    Contributor

    The mention of window switching reminds me of #90838, but the error logs are different. Would appreciate if someone investigates into reproduction.

  11. darshankawar commented on Jan 25, 2022

    @darshankawar
    Member

    @elham-rababah @efreibe Can you provide a complete minimal reproducible code sample along with steps to replicate this error ?

  12. added
    P2Important issues not at the top of the work list
    on Jan 27, 2022
  13. github-actions commented on Feb 11, 2022

    @github-actions

    Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now.
    If you find this problem please file a new issue with the same description, what happens, logs and the output of 'flutter doctor -v'. All system setups can be slightly different so it's always better to open new issues and reference the related ones.
    Thanks for your contribution.

  14. github-actions commented on Feb 25, 2022

    @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.

  15. locked as resolved and limited conversation to collaborators on Feb 25, 2022
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

    P2Important issues not at the top of the work lista: desktopRunning on desktopc: regressionIt was better in the past than it is nowin triagePresently being triaged by the triage teamplatform-linuxBuilding on or for Linux specificallyplatform-macosBuilding on or for macOS specificallywaiting for responseThe Flutter team cannot make further progress on this issue until the original reporter responds

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions