flutter / flutter-intellij

Flutter Plugin for IntelliJ
https://flutter.dev/using-ide
BSD 3-Clause "New" or "Revised" License
1.98k stars 319 forks source link

[Widget Inspector] Errors selecting on Crane example in mdc-flutter experimental #3227

Closed willlarche closed 5 years ago

willlarche commented 5 years ago

App

https://github.com/material-components/material-components-flutter-experimental/tree/master/advanced

Steps to recreate

  1. Run app
  2. Click on 'Crane' button
  3. Open inspector and enter selection mode
  4. See error #⁠1
  5. Close selction mode
  6. See error #⁠2

Errors

1. Selection on: simulator screen shot - iphone 8 plus - 2019-02-24 at 12 00 32

flutter: ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════
flutter: The following assertion was thrown building Title(title: "Crane", color: Color(0xff5d1049)):
flutter: 'package:flutter/src/widgets/widget_inspector.dart': Failed assertion: line 2184 pos 12:
flutter: 'WidgetInspectorService.instance.selectionChangedCallback == null': is not true.
flutter:
flutter: Either the assertion indicates an error in the framework itself, or we should provide substantially
flutter: more information in this error message to help you determine and fix the underlying cause.
flutter: In either case, please report this assertion by filing a bug on GitHub:
flutter:   https://github.com/flutter/flutter/issues/new?template=BUG.md
flutter:
flutter: When the exception was thrown, this was the stack:
flutter: #2      _WidgetInspectorState.initState (package:flutter/src/widgets/widget_inspector.dart:2184:12)
flutter: #3      StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:3846:58)
flutter: #4      ComponentElement.mount (package:flutter/src/widgets/framework.dart:3711:5)
flutter: #5      Element.inflateWidget (package:flutter/src/widgets/framework.dart:2956:14)
flutter: #6      Element.updateChild (package:flutter/src/widgets/framework.dart:2759:12)
flutter: #7      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #8      Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #9      StatelessElement.update (package:flutter/src/widgets/framework.dart:3796:5)
flutter: #10     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #11     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #12     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #13     ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
flutter: #14     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #15     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #16     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #17     ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
flutter: #18     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #19     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #20     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #21     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #22     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #23     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #24     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #25     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #26     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #27     ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
flutter: #28     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #29     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #30     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #31     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #32     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #33     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #34     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #35     ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
flutter: #36     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #37     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #38     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #39     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #40     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #41     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #42     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #43     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #44     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #45     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #46     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #47     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #48     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #49     StatelessElement.update (package:flutter/src/widgets/framework.dart:3796:5)
flutter: #50     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #51     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #52     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #53     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #54     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #55     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:4601:32)
flutter: #56     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4992:17)
flutter: #57     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #58     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #59     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #60     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #61     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #62     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #63     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #64     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #65     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #66     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #67     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #68     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #69     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #70     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #71     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #72     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #73     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #74     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #75     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #76     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #77     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #78     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #79     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #80     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #81     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #82     StatelessElement.update (package:flutter/src/widgets/framework.dart:3796:5)
flutter: #83     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #84     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #85     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #86     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #87     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #88     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #89     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #90     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #91     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #92     ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
flutter: #93     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #94     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #95     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #96     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #97     Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #98     StatefulElement.update (package:flutter/src/widgets/framework.dart:3894:5)
flutter: #99     Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #100    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #101    Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #102    StatelessElement.update (package:flutter/src/widgets/framework.dart:3796:5)
flutter: #103    Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #104    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:4883:14)
flutter: #105    Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #106    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #107    Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #108    ProxyElement.update (package:flutter/src/widgets/framework.dart:4006:5)
flutter: #109    Element.updateChild (package:flutter/src/widgets/framework.dart:2748:15)
flutter: #110    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:3747:16)
flutter: #111    Element.rebuild (package:flutter/src/widgets/framework.dart:3559:5)
flutter: #112    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2273:33)
flutter: #113    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:700:20)
flutter: #114    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:275:5)
flutter: #115    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
flutter: #116    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
flutter: #117    _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
flutter: #121    _invoke (dart:ui/hooks.dart:209:10)
flutter: #122    _drawFrame (dart:ui/hooks.dart:168:3)
flutter: (elided 5 frames from class _AssertionError and package dart:async)
flutter: ════════════════════════════════════════════════════════════════════════════════════════════════════
flutter: Another exception was thrown: AnimationController.dispose() called more than once.

2. Selection off:

simulator screen shot - iphone 8 plus - 2019-02-24 at 12 00 37

flutter: Another exception was thrown: Multiple widgets used the same GlobalKey.
flutter: Another exception was thrown: Duplicate GlobalKey detected in widget tree.

Version Info

willlarche commented 5 years ago

Must have been in some weird state. I downgraded to 1.2.1 to use the inspector (it worked.) And then upgraded back to master 1.2.3-pre.29. Issue not reproduced anymore.

stevemessick commented 5 years ago

@jacob314 This looks like an inspector issue.

willlarche commented 5 years ago

Am I in the wrong repo?

stevemessick commented 5 years ago

I think you're in the right place.

jacob314 commented 5 years ago

Thanks for the great repro steps! I'll take a look at what is happening. Technically this is the package:flutter bug but I'm the right person to fix it so it doesn't matter much.

jacob314 commented 5 years ago

Merging reports of this issue into. https://github.com/flutter/flutter/issues/25707