Skip to content

Poor messaging for assert when getting local coordinates of RenderBox: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1342 #7703

Closed

Description

@apwilson
16:28:26.258: I/flutter (13143): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
16:28:26.262: I/flutter (13143): The following assertion was thrown building ArmadilloDragTarget<StoryClusterId>(dirty; state:
16:28:26.265: I/flutter (13143): _DragTargetState<StoryClusterId>(564928223)):
16:28:26.267: I/flutter (13143): 'package:flutter/src/rendering/box.dart': Failed assertion: line 1342: 'debugDoingThisResize ||
16:28:26.270: I/flutter (13143): debugDoingThisLayout ||
16:28:26.273: I/flutter (13143):                   (RenderObject.debugActiveLayout == parent && _size._canBeUsedByParent)': is not
16:28:26.276: I/flutter (13143):                   true.
16:28:26.278: I/flutter (13143):
16:28:26.281: I/flutter (13143): Either the assertion indicates an error in the framework itself, or we should provide substantially
16:28:26.284: I/flutter (13143): more information in this error message to help you determine and fix the underlying cause.
16:28:26.287: I/flutter (13143): In either case, please report this assertion by filing a bug on GitHub:
16:28:26.289: I/flutter (13143):   https://github.com/flutter/flutter/issues/new
16:28:26.292: I/flutter (13143):
16:28:26.294: I/flutter (13143): When the exception was thrown, this was the stack:
16:28:26.297: I/flutter (13143): #2      RenderBox.size.<anonymous closure> (package:flutter/src/rendering/box.dart:1342)
16:28:26.300: I/flutter (13143): #4      RenderBox.size (package:flutter/src/rendering/box.dart:1332)
16:28:26.303: I/flutter (13143): #5      RenderTransform._effectiveTransform (package:flutter/src/rendering/proxy_box.dart:1428)
16:28:26.305: I/flutter (13143): #6      RenderTransform.applyPaintTransform (package:flutter/src/rendering/proxy_box.dart:1469)
16:28:26.308: I/flutter (13143): #7      RenderBox._collectPaintTransform (package:flutter/src/rendering/box.dart:1769)
16:28:26.311: I/flutter (13143): #8      RenderBox.globalToLocal (package:flutter/src/rendering/box.dart:1779)
16:28:26.314: I/flutter (13143): #9      PanelDragTargetsState.build.<anonymous closure>.<anonymous closure> (/usr/local/google/home/anwilson/fuchsia/apps/sysui/armadillo/lib/panel_drag_targets.dart:297)
16:28:26.316: I/flutter (13143): #10     Iterable.forEach (dart:core/iterable.dart:226)
16:28:26.319: I/flutter (13143): #11     PanelDragTargetsState.build.<anonymous closure> (/usr/local/google/home/anwilson/fuchsia/apps/sysui/armadillo/lib/panel_drag_targets.dart:293)
16:28:26.322: I/flutter (13143): #12     _DragTargetState.build (/usr/local/google/home/anwilson/fuchsia/apps/sysui/armadillo/lib/armadillo_drag_target.dart:295)
16:28:26.324: I/flutter (13143): #13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:2872)
16:28:26.327: I/flutter (13143): #14     BuildableElement.rebuild (package:flutter/src/widgets/framework.dart:2767)
16:28:26.329: I/flutter (13143): #15     StatefulElement.update (package:flutter/src/widgets/framework.dart:3009)
16:28:26.332: I/flutter (13143): #16     Element.updateChild (package:flutter/src/widgets/framework.dart:2050)
16:28:26.335: I/flutter (13143): #17     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:2884)
16:28:26.338: I/flutter (13143): #18     BuildableElement.rebuild (package:flutter/src/widgets/framework.dart:2767)
16:28:26.340: I/flutter (13143): #19     StatefulElement.update (package:flutter/src/widgets/framework.dart:3009)
16:28:26.343: I/flutter (13143): #20     Element.updateChild (package:flutter/src/widgets/framework.dart:2050)
16:28:26.346: I/flutter (13143): #21     _LayoutBuilderElement._layout.<anonymous closure> (package:flutter/src/widgets/layout_builder.dart:120)
16:28:26.348: I/flutter (13143): #22     BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:1731)
16:28:26.351: I/flutter (13143): #23     _LayoutBuilderElement._layout (package:flutter/src/widgets/layout_builder.dart:108)
16:28:26.354: I/flutter (13143): #24     RenderObject.invokeLayoutCallback.<anonymous closure> (package:flutter/src/rendering/object.dart:1833)
16:28:26.357: I/flutter (13143): #25     PipelineOwner._enableMutationsToDirtySubtrees (package:flutter/src/rendering/object.dart:975)
16:28:26.360: I/flutter (13143): #26     RenderObject.invokeLayoutCallback (package:flutter/src/rendering/object.dart:1833)
16:28:26.362: I/flutter (13143): #27     _RenderLayoutBuilder.performLayout (package:flutter/src/widgets/layout_builder.dart:207)
16:28:26.365: I/flutter (13143): #28     RenderObject.layout (package:flutter/src/rendering/object.dart:1735)
16:28:26.368: I/flutter (13143): #29     RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:536)
16:28:26.374: I/flutter (13143): #30     RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1611)
16:28:26.377: I/flutter (13143): #31     PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:953)
16:28:26.380: I/flutter (13143): #32     BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding.beginFrame (package:flutter/src/rendering/binding.dart:220)
16:28:26.382: I/flutter (13143): #33     BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding&WidgetsBinding.beginFrame (package:flutter/src/widgets/binding.dart:314)
16:28:26.385: I/flutter (13143): #34     BindingBase&SchedulerBinding&GestureBinding&ServicesBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:165)
16:28:26.388: I/flutter (13143): #35     BindingBase&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:652)
16:28:26.390: I/flutter (13143): #36     BindingBase&SchedulerBinding.handleBeginFrame (package:flutter/src/scheduler/binding.dart:587)
16:28:26.393: I/flutter (13143): #37     _beginFrame (file:///b/build/slave/Linux_Engine/build/src/flutter/lib/ui/hooks.dart:83)
16:28:26.396: I/flutter (13143): (elided 3 frames from class _AssertionError)
16:28:26.398: I/flutter (13143): ════════════════════════════════════════════════════════════════════════════════════════════════════

Activity

  1. changed the title [-]Assert indicates to file an issue[/-] [+]'package:flutter/src/rendering/box.dart': Failed assertion: line 1342[/+] on Jan 27, 2017
  2. changed the title [-]'package:flutter/src/rendering/box.dart': Failed assertion: line 1342[/-] [+]Getting local coordinates of RenderBox: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1342[/+] on Jan 27, 2017
  3. abarth commented on Jan 27, 2017

    @abarth
    Contributor

    PanelDragTargetsState.build is calling RenderBox.globalToLocal during its build, which is not legit. The positions of objects haven't been determined yet at the time build is called.

  4. apwilson commented on Jan 27, 2017

    @apwilson
    ContributorAuthor

    Okay. The assert should say as much rather than directing me to file an issue.

  5. apwilson commented on Jan 27, 2017

    @apwilson
    ContributorAuthor

    ie. "You are attempting to access the size and/or position of a RenderBox during the build phase. You can't do that." full stop

    By it saying it's a bug in the framework it makes me put the onus on you to fix rather than me.

  6. changed the title [-]Getting local coordinates of RenderBox: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1342[/-] [+]Poor messaging for assert when getting local coordinates of RenderBox: 'package:flutter/src/rendering/box.dart': Failed assertion: line 1342[/+] on Jan 27, 2017
  7. added this to the milestone on Feb 28, 2017
  8. added
    c: crashStack traces logged to the console
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Oct 3, 2017
  9. modified the milestones: 3: Current Milestone, on Dec 20, 2017
  10. zoechi commented on Jan 9, 2019

    @zoechi
    Contributor

    Same exception in #14489

  11. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  12. removed this from the milestone on Jun 2, 2020
  13. removed this from the milestone on Jun 2, 2020
  14. self-assigned this
    on Jul 2, 2020
  15. modified the milestones: , 1.21 - July 2020 on Jul 2, 2020
  16. github-actions commented on Aug 19, 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.

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

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: error messageError messages from the Flutter frameworkc: crashStack traces logged to the consoleframeworkflutter/packages/flutter repository. See also f: labels.waiting for PR to land (fixed)A fix is in flight

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions