Repository navigation
mouse_tracking.dart failed assertion #64129
Description
Steps to Reproduce
I do not have a compact reproducer. The code that seems to trigger the problem looks like:
class LMPredPage extends ScaffoldWidget {
const LMPredPage({Key key}) : super('LM Preds', key: key);
@override
Widget body(BuildContext context) {
return ListView(
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: ...,
)
]
);
}
}
The problem is observed when doing a hot reload in debug mode on Android Studio with a macOS target.
Expected results:
No assertions.
Actual results:
Logs
════════ Exception caught by gesture library ═══════════════════════════════════════════════════════
The following assertion was thrown while routing a pointer event:
'package:flutter/src/rendering/mouse_tracking.dart': Failed assertion: line 392 pos 12: '!_debugDuringDeviceUpdate': 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=BUG.md
When the exception was thrown, this was the stack:
#2 BaseMouseTracker._deviceUpdatePhase (package:flutter/src/rendering/mouse_tracking.dart:392:12)
#3 BaseMouseTracker._handleEvent. (package:flutter/src/rendering/mouse_tracking.dart:477:7)
#4 BaseMouseTracker._monitorMouseConnection (package:flutter/src/rendering/mouse_tracking.dart:381:9)
#5 BaseMouseTracker._handleEvent (package:flutter/src/rendering/mouse_tracking.dart:476:5)
#6 PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:77:12)
flutter doctor -v
[✓] Flutter (Channel dev, 1.21.0-9.0.pre, on Mac OS X 10.15.4 19E287, locale en-US)
• Flutter version 1.21.0-9.0.pre at /Users/chip/dev/flutter
• Framework revision 7c6f9dd (10 days ago), 2020-08-09 10:31:03 -0400
• Engine revision 6d86e67
• Dart version 2.10.0 (build 2.10.0-4.0.dev 0341576448)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/chip/Library/Android/sdk/
• Platform android-29, build-tools 29.0.3
• ANDROID_HOME = /Applications/android-sdks/
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.6)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.6, Build version 11E708
• CocoaPods version 1.9.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 45.1.1
• Dart plugin version 192.8052
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[!] VS Code (version 1.45.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
✗ Flutter extension not installed; install from
https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.4 19E287
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome 84.0.4147.125
! Doctor found issues in 1 category.
Activity
pedromassangocode commentedon Aug 19, 2020
Hi @chipkent
Does the code bellow reproduce the issue for you?
sample code
chipkent commentedon Aug 31, 2020
Sorry for the delay. This did not reproduce the problem.
pedromassangocode commentedon Aug 31, 2020
Hi @chipkent
I cannot reproduce this issue on latest
devchannel.Can you upgrade to
masterand try againflutter channel masterflutter upgrade --forceflutter doctor -vTahaTesser commentedon Oct 14, 2020
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.
oakstair commentedon Oct 31, 2020
We are phasing the same issue in a web project using the latest stable channel. We did start to get these errors after last stable release.
Unfortunately at this moment we do not have a minimal project to share.
════════ Exception caught by scheduler library ═════════════════════════════════════════════════════ Assertion failed: file:///Users/gunnar/dev/flutter/packages/flutter/lib/src/rendering/mouse_tracking.dart:301:12 !_debugDuringDeviceUpdate is not trueI guess using master is not an option for a web project :-(
`
gunnar@iMac aemee-flutter-poc % flutter devices
2 connected devices:
Web Server (web) • web-server • web-javascript • Flutter Tools
Chrome (web) • chrome • web-javascript • Google Chrome 86.0.4240.111
gunnar@iMac aemee-flutter-poc % flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, 1.23.0-18.1.pre, on Mac OS X 10.15.7 19H2 x86_64, locale sv-SE)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
✗ Android license status unknown.
Run
flutter doctor --android-licensesto accept the SDK licenses.See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 4.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2020.2.3)
[✓] Connected device (2 available)
! Doctor found issues in 1 category.
`
oakstair commentedon Oct 31, 2020
TahaTesser commentedon Nov 2, 2020
Could everyone who still has this problem please file a new issue with the exact description of 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 related issues.
oakstair commentedon Nov 2, 2020
This is what our developer who has now coded around this bug stated:
In the latets flutter version, inkwell can not be dragged with an effect (onTap, onHover, onLongPressed)
SethKitchen commentedon Dec 8, 2020
Same error with InkWell -- weird it doesn't care about directionality until a random drag time. I Tried to wrap my App with Directionality but it doesn't work.
errors.dart:167 Uncaught Error: No Directionality widget found.
_InkResponseStateWidget widgets require a Directionality widget ancestor.
The specific widget that could not find a Directionality ancestor was:
_InkResponseStateWidget
The ownership chain for the affected widget is: "_InkResponseStateWidget ← InkWell ← Semantics ← DefaultTextStyle ← AnimatedDefaultTextStyle ← _InkFeatures-[GlobalKey#bc79c ink renderer] ← NotificationListener ← CustomPaint ← ShapeBorderPaint ← PhysicalShape ← ⋯"
Typically, the Directionality widget is introduced by the MaterialApp or WidgetsApp widget at the top of your application widget tree. It determines the ambient reading direction and is used, for example, to determine how to lay out text, how to interpret "start" and "end" values, and to resolve EdgeInsetsDirectional, AlignmentDirectional, and other *Directional objects.
at Object.throw [as throw] (errors.dart:216)
at debug.dart:271
at Object.debugCheckHasDirectionality (debug.dart:290)
at Function.of (basic.dart:117)
at ink_well._InkResponseState.new.updateHighlight (ink_well.dart:850)
at ink_well._InkResponseState.new.[_handleHoverChange] (ink_well.dart:1059)
at ink_well._InkResponseState.new.[_handleMouseEnter] (ink_well.dart:1047)
at Function._handleDeviceUpdateMouseEvents (mouse_tracking.dart:502)
at mouse_tracking.MouseTracker.new.handleDeviceUpdate (mouse_tracking.dart:510)
at mouse_tracking.dart:428
at mouse_tracking.MouseTracker.new.[_deviceUpdatePhase] (mouse_tracking.dart:306)
at mouse_tracking.dart:408
at mouse_tracking.MouseTracker.new.[_monitorMouseConnection] (mouse_tracking.dart:290)
at mouse_tracking.MouseTracker.new.updateWithEvent (mouse_tracking.dart:407)
at binding$5.WidgetsFlutterBinding.new.dispatchEvent (binding.dart:276)
at binding$5.WidgetsFlutterBinding.new.[_handlePointerEventImmediately] (binding.dart:316)
at binding$5.WidgetsFlutterBinding.new.handlePointerEvent (binding.dart:280)
at binding$5.WidgetsFlutterBinding.new.[_flushPointerEventQueue] (binding.dart:238)
at binding$5.WidgetsFlutterBinding.new.[_handlePointerDataPacket] (binding.dart:221)
at Object.invoke1 (platform_dispatcher.dart:907)
at _engine.EnginePlatformDispatcher..invokeOnPointerDataPacket (platform_dispatcher.dart:170)
at _engine.PointerBinding..[onPointerData] (pointer_binding.dart:128)
at pointer_binding.dart:513
at pointer_binding.dart:485
at pointer_binding.dart:208
DartError @ errors.dart:167
throw @ errors.dart:216
(anonymous) @ debug.dart:271
debugCheckHasDirectionality @ debug.dart:290
of @ basic.dart:117
updateHighlight @ ink_well.dart:850
[_handleHoverChange] @ ink_well.dart:1059
[_handleMouseEnter] @ ink_well.dart:1047
_handleDeviceUpdateMouseEvents @ mouse_tracking.dart:502
handleDeviceUpdate @ mouse_tracking.dart:510
(anonymous) @ mouse_tracking.dart:428
[_deviceUpdatePhase] @ mouse_tracking.dart:306
(anonymous) @ mouse_tracking.dart:408
[_monitorMouseConnection] @ mouse_tracking.dart:290
updateWithEvent @ mouse_tracking.dart:407
dispatchEvent @ binding.dart:276
[_handlePointerEventImmediately] @ binding.dart:316
handlePointerEvent @ binding.dart:280
[_flushPointerEventQueue] @ binding.dart:238
[_handlePointerDataPacket] @ binding.dart:221
invoke1 @ platform_dispatcher.dart:907
invokeOnPointerDataPacket @ platform_dispatcher.dart:170
[_onPointerData] @ pointer_binding.dart:128
(anonymous) @ pointer_binding.dart:513
(anonymous) @ pointer_binding.dart:485
(anonymous) @ pointer_binding.dart:208
32errors.dart:167 Uncaught Error: Assertion failed: file:///D:/git/flutter/packages/flutter/lib/src/rendering/mouse_tracking.dart:301:12
!debugDuringDeviceUpdate
is not true
at Object.throw [as throw] (errors.dart:216)
at Object.assertFailed (errors.dart:24)
at mouse_tracking.MouseTracker.new.[_deviceUpdatePhase] (mouse_tracking.dart:301)
at mouse_tracking.dart:408
at mouse_tracking.MouseTracker.new.[_monitorMouseConnection] (mouse_tracking.dart:290)
at mouse_tracking.MouseTracker.new.updateWithEvent (mouse_tracking.dart:407)
at binding$5.WidgetsFlutterBinding.new.dispatchEvent (binding.dart:276)
at binding$5.WidgetsFlutterBinding.new.[_handlePointerEventImmediately] (binding.dart:316)
at binding$5.WidgetsFlutterBinding.new.handlePointerEvent (binding.dart:280)
at binding$5.WidgetsFlutterBinding.new.[_flushPointerEventQueue] (binding.dart:238)
at binding$5.WidgetsFlutterBinding.new.[_handlePointerDataPacket] (binding.dart:221)
at Object.invoke1 (platform_dispatcher.dart:907)
at _engine.EnginePlatformDispatcher..invokeOnPointerDataPacket (platform_dispatcher.dart:170)
at _engine.PointerBinding..[_onPointerData] (pointer_binding.dart:128)
at pointer_binding.dart:513
at pointer_binding.dart:485
at pointer_binding.dart:208
TahaTesser commentedon Dec 9, 2020
Could everyone who still has this problem please file a new issue with the exact description of 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 related issues.
github-actions commentedon Aug 9, 2021
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.