Skip to content

InspectorOverlayer failed assertion #6032

Closed

Description

@CoderDake

When inspecting a widget using the standard setup from https://github.com/goderbauer/mvp, The following error occurs:

Exception
══╡ EXCEPTION CAUGHT BY SCHEDULER LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during a scheduler callback:
'package:flutter/src/foundation/math.dart': Failed assertion: line 12 pos 10: 'min <= max &&
!max.isNaN && !min.isNaN': 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      clampDouble (package:flutter/src/foundation/math.dart:12:10)
#3      _TextPainterLayoutCacheWithOffset._contentWidthFor (package:flutter/src/painting/text_painter.dart:371:32)
#4      new _TextPainterLayoutCacheWithOffset (package:flutter/src/painting/text_painter.dart:332:22)
#5      TextPainter.layout (package:flutter/src/painting/text_painter.dart:1088:62)
#6      _InspectorOverlayLayer._paintDescription (package:flutter/src/widgets/widget_inspector.dart:3208:11)
#7      _InspectorOverlayLayer._buildPicture (package:flutter/src/widgets/widget_inspector.dart:3181:5)
#8      _InspectorOverlayLayer.addToScene (package:flutter/src/widgets/widget_inspector.dart:3132:18)
#9      Layer._addToSceneWithRetainedRendering (package:flutter/src/rendering/layer.dart:710:5)
#10     ContainerLayer.addChildrenToScene (package:flutter/src/rendering/layer.dart:1378:13)
#11     TransformLayer.addToScene (package:flutter/src/rendering/layer.dart:1997:5)
#12     ContainerLayer.buildScene (package:flutter/src/rendering/layer.dart:1130:5)
#13     RenderView.compositeFrame (package:flutter/src/rendering/view.dart:252:37)
#14     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:596:20)
#15     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:960:13)
#16     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:457:5)
#17     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1297:15)
#18     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1227:9)
#19     SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:1085:5)
#20     _invoke (dart:ui/hooks.dart:189:13)
#21     PlatformDispatcher._drawFrame (dart:ui/platform_dispatcher.dart:442:5)
#22     _drawFrame (dart:ui/hooks.dart:159:31)
(elided 2 frames from class _AssertionError)
════════════════════════════════════════════════════════════════════════════════════════

I haven't nailed down the exact action that recreates it yet.
It should at least be one of the following:

  • turn widget inspection off then on, click on the multi view app to inspect a widget
  • turn widget inspection off then on, click on a widget the devtools widget tree,

When I narrow down the specific trigger I'll report back here

Activity

  1. self-assigned this
    on Jul 13, 2023
  2. CoderDake commented on Jul 13, 2023

    @CoderDake
    ContributorAuthor

    I've tried to recreate this on the template app created by flutter create.
    I've used the --local-engine, and used the default engine.

    I was not able to reproduce with that app. So something tells me this has something to do with the way Widget inspectors exist in those multi view apps.

  3. CoderDake commented on Jul 13, 2023

    @CoderDake
    ContributorAuthor

    It looks like this error pops up if you try to click any of the Text widgets in DevTools. This must be done before the any Widgets are selected on the app itself.

  4. CoderDake commented on Jul 13, 2023

    @CoderDake
    ContributorAuthor

    Retested with the local engine on the fresh single view flutter app. This error doesn't seem to happen.

    So this makes me thing that something weird happens in the multi view apps, before the first inspection click on the app

  5. CoderDake commented on Jul 21, 2023

    @CoderDake
    ContributorAuthor

    After doing some more debugging I found out that there is a 4th ghost view in the widget tree of the app, even though there are only 3 windows that open when the app is run.
    As it turns out all of the errors I was running into were when clicking on widgets inside that ghost view, and then afterwards the inspection would be janky which made me thing all of the views were having issues.

    Screenshot 2023-07-21 at 11 25 51 AM

    So it looks like this error is happening when the view is too small to support that calculations that _paintDescription does. Which is the case for this ghostview since the INspectorOverlayer thinks that the size of the selected object is (0,0).

    I talked to goderbauer about the ghost view and he mentioned that the extra ghost view is a flutter engine bug that they are working on.

  6. CoderDake commented on Jul 21, 2023

    @CoderDake
    ContributorAuthor

    Flutter Engine issue that caused the Ghost View to show up:
    flutter/flutter#131089

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions