Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silver_multi_box_adaptor 'indexOf(child) == index' is not true #31081

Closed
MilesAdamson opened this issue Apr 15, 2019 · 4 comments
Closed

silver_multi_box_adaptor 'indexOf(child) == index' is not true #31081

MilesAdamson opened this issue Apr 15, 2019 · 4 comments
Labels
f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Comments

@MilesAdamson
Copy link

The app has a login page, then a screen with a ListView which is populated based on the login. Upon logging out, you are brought back to the login screen and the following exceptions all throw. I wish I had more information but I really have no idea what's going on. I don't even know which widgets in the app are causing this.

Logs

[ +148 ms] I/flutter (16440): ══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
[ +5 ms] I/flutter (16440): The following assertion was thrown during performLayout():
[ +1 ms] I/flutter (16440): 'package:flutter/src/rendering/sliver_multi_box_adaptor.dart': Failed assertion: line 583 pos 16:
[ +1 ms] I/flutter (16440): 'indexOf(child) == index': is not true.
[ ] I/flutter (16440):
[ ] I/flutter (16440): Either the assertion indicates an error in the framework itself, or we should provide substantially
[ ] I/flutter (16440): more information in this error message to help you determine and fix the underlying cause.
[ ] I/flutter (16440): In either case, please report this assertion by filing a bug on GitHub:
[ ] I/flutter (16440): https://github.com/flutter/flutter/issues/new?template=BUG.md
[ ] I/flutter (16440):
[ ] I/flutter (16440): When the exception was thrown, this was the stack:
[ ] I/flutter (16440): #2 RenderSliverMultiBoxAdaptor.debugAssertChildListIsNonEmptyAndContiguous. (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:583:16)
[ ] I/flutter (16440): #3 RenderSliverMultiBoxAdaptor.debugAssertChildListIsNonEmptyAndContiguous (package:flutter/src/rendering/sliver_multi_box_adaptor.dart:587:6)
[ ] I/flutter (16440): #4 RenderSliverList.performLayout (package:flutter/src/rendering/sliver_list.dart:253:12)
[ ] I/flutter (16440): #5 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #6 RenderSliverPadding.performLayout (package:flutter/src/rendering/sliver_padding.dart:182:11)
[ ] I/flutter (16440): #7 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #8 RenderViewportBase.layoutChildSequence (package:flutter/src/rendering/viewport.dart:407:13)
[ ] I/flutter (16440): #9 RenderViewport._attemptLayout (package:flutter/src/rendering/viewport.dart:1322:12)
[ ] I/flutter (16440): #10 RenderViewport.performfLayout (package:flutter/src/rendering/viewport.dart:1240:20)
[ ] I/flutter (16440): #11 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ +1 ms] I/flutter (16440): #12 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (16440): #13 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #14 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (16440): #15 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #16 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (16440): #17 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #18 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (16440): #19 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #20 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (16440): #21 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #22 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (16440): #23 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #24 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (16440): #25 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #26 _RenderProxyBox&RenderBox&RenderObjectWithChildMixin&RenderProxyBoxMixin.performLayout (package:flutter/src/rendering/proxy_box.dart:105:13)
[ ] I/flutter (16440): #27 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #28 RenderFlex.performLayout (package:flutter/src/rendering/flex.dart:798:17)
[ ] I/flutter (16440): #29 RenderObject.layout (package:flutter/src/rendering/object.dart:1632:7)
[ ] I/flutter (16440): #30 MultiChildLayoutDelegate.layoutChild (package:flutter/src/rendering/custom_layout.dart:142:11)
[ ] I/flutter (16440): #31 _ScaffoldLayout.performLayout (package:flutter/src/material/scaffold.dart:431:7)
[ ] I/flutter (16440): #32 MultiChildLayoutDelegate._callPerformLayout (package:flutter/src/rendering/custom_layout.dart:212:7)
[ ] I/flutter (16440): #33 RenderCustomMultiChildLayoutBox.performLayout (package:flutter/src/rendering/custom_layout.dart:356:14)
[ ] I/flutter (16440): #34 RenderObject._layoutWithoutResize (package:flutter/src/rendering/object.dart:1507:7)
[ ] I/flutter (16440): #35 PipelineOwner.flushLayout (package:flutter/src/rendering/object.dart:766:18)
[ ] I/flutter (16440): #36 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:336:19)
[ ] I/flutter (16440): #37 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding&WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:701:13)
[ ] I/flutter (16440): #38 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding&PaintingBinding&SemanticsBinding&RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:275:5)
[ ] I/flutter (16440): #39 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:990:15)
[ ] I/flutter (16440): #40 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:930:9)
[ ] I/flutter (16440): #41 _WidgetsFlutterBinding&BindingBase&GestureBinding&ServicesBinding&SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:842:5)
[ ] I/flutter (16440): #45 _invoke (dart:ui/hooks.dart:209:10)
[ ] I/flutter (16440): #46 _drawFrame (dart:ui/hooks.dart:168:3)
[ ] I/flutter (16440): (elided 5 frames from class _AssertionError and package dart:async)
[ +1 ms] I/flutter (16440):
[ +6 ms] I/flutter (16440): The following RenderObject was being processed when the exception was fired:
[ ] I/flutter (16440): RenderSliverList#64ecd relayoutBoundary=up2 NEEDS-LAYOUT NEEDS-PAINT
[ ] I/flutter (16440): creator: SliverList ← MediaQuery ← SliverPadding ← Viewport ← IgnorePointer-[GlobalKey#a7a97] ←
[ ] I/flutter (16440): Semantics ← Listener ← _GestureSemantics ←
[ ] I/flutter (16440): RawGestureDetector-[LabeledGlobalKey#e53dd] ← _ScrollableScope ←
[ +1 ms] I/flutter (16440): _ScrollSemantics-[GlobalKey#6a18d] ← RepaintBoundary ← ⋯
[ ] I/flutter (16440): parentData: paintOffset=Offset(0.0, 0.0) (can use size)
[ ] I/flutter (16440): constraints: SliverConstraints(AxisDirection.down, GrowthDirection.forward, ScrollDirection.idle,
[ ] I/flutter (16440): scrollOffset: 0.0, remainingPaintExtent: 256.7, crossAxisExtent: 360.0, crossAxisDirection:
[ +1 ms] I/flutter (16440): AxisDirection.right, viewportMainAxisExtent: 256.7, remainingCacheExtent: 506.7 cacheOrigin: 0.0 )
[ ] I/flutter (16440): geometry: SliverGeometry(scrollExtent: 765.0, paintExtent: 535.0, maxPaintExtent: 765.0,
[ ] I/flutter (16440): hasVisualOverflow: true, cacheExtent: 765.0)
[ ] I/flutter (16440): currently live children: 1 to 17
[ ] I/flutter (16440): This RenderObject had the following descendants (showing up to depth 5):
[ ] I/flutter (16440): RenderIndexedSemantics#d6a9a relayoutBoundary=up3 NEEDS-PAINT
[ ] I/flutter (16440): RenderRepaintBoundary#25785 relayoutBoundary=up4 NEEDS-PAINT
[ ] I/flutter (16440): RenderConstrainedBox#5d1d3 relayoutBoundary=up5 NEEDS-PAINT
[ ] I/flutter (16440): RenderPositionedBox#87a14 NEEDS-PAINT
[ ] I/flutter (16440): RenderPadding#70e82 relayoutBoundary=up1 NEEDS-PAINT
[ ] I/flutter (16440): RenderIndexedSemantics#d679e relayoutBoundary=up3 NEEDS-PAINT
[ ] I/flutter (16440): RenderRepaintBoundary#e8491 relayoutBoundary=up4 NEEDS-PAINT
[ ] I/flutter (16440): RenderConstrainedBox#30022 relayoutBoundary=up5 NEEDS-PAINT
[ ] I/flutter (16440): RenderPositionedBox#03b10 NEEDS-PAINT
[ ] I/flutter (16440): RenderPadding#e2d99 relayoutBoundary=up1 NEEDS-PAINT
[ ] I/flutter (16440): RenderIndexedSemantics#227ee relayoutBoundary=up3 NEEDS-PAINT
[ ] I/flutter (16440): RenderRepaintBoundary#314b6 relayoutBoundary=up4 NEEDS-PAINT
[ ] I/flutter (16440): RenderConstrainedBox#46124 relayoutBoundary=up5 NEEDS-PAINT
[ ] I/flutter (16440): RenderPositionedBox#402f7 NEEDS-PAINT
[ ] I/flutter (16440): RenderPadding#6ee06 relayoutBoundary=up1 NEEDS-PAINT
[ ] I/flutter (16440): RenderIndexedSemantics#196b2 relayoutBoundary=up3 NEEDS-PAINT
[ ] I/flutter (16440): RenderRepaintBoundary#cce98 relayoutBoundary=up4 NEEDS-PAINT
[ ] I/flutter (16440): RenderConstrainedBox#288f9 relayoutBoundary=up5 NEEDS-PAINT
[ ] I/flutter (16440): RenderPositionedBox#fc1c1 NEEDS-PAINT
[ ] I/flutter (16440): RenderPadding#98c11 relayoutBoundary=up1 NEEDS-PAINT
[ ] I/flutter (16440): RenderIndexedSemantics#8bee5 relayoutBoundary=up3 NEEDS-PAINT
[ ] I/flutter (16440): RenderRepaintBoundary#3b2fb relayoutBoundary=up4 NEEDS-PAINT
[ ] I/flutter (16440): RenderConstrainedBox#f1350 relayoutBoundary=up5 NEEDS-PAINT
[ ] I/flutter (16440): RenderPositionedBox#2cef2 NEEDS-PAINT
[ +1 ms] I/flutter (16440): RenderPadding#c5e00 relayoutBoundary=up1 NEEDS-PAINT
[ +1 ms] I/flutter (16440): ...(descendants list truncated after 25 lines)
[ ] I/flutter (16440): ════════════════════════════════════════════════════════════════════════════════════════════════════

Doctor (not using Android Studio, using Intellij)

[√] Flutter (Channel beta, v1.3.8, on Microsoft Windows [Version 10.0.17763.437], locale en-CA)
• Flutter version 1.3.8 at C:\Users\madam\flutter
• Framework revision e5b1ed7 (6 weeks ago), 2019-03-06 14:23:37 -0800
• Engine revision f4951df
• Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)

[√] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\madam\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.

[!] Android Studio (version 3.3)
• Android Studio at C:\Program Files\Android\Android Studio
X Flutter plugin not installed; this adds Flutter specific functionality.
X Dart plugin not installed; this adds Dart specific functionality.
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[√] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2018.3.5
• Flutter plugin version 33.4.2
• Dart plugin version 183.5912.23

@MilesAdamson
Copy link
Author

I fixed the issue. On one screen, there was a ListView whose entries depended on login information. The list items were built in the build method of the widget. Upon logging out and logging in again as someone else, the data that builds the ListView changed and this screen crashed in the background with the exception given above.

To fix I put the building of the ListView inside the .listen() of a StreamSubscription, so that it updates in the background when the login state changes.

A more detailed error message could be about the data of a list changing without the widgets changing or something

@escamoteur escamoteur added a: error message Error messages from the Flutter framework documentation labels Oct 1, 2019
@escamoteur escamoteur modified the milestones: Stretch Goals, Goals Oct 1, 2019
@iapicca
Copy link
Contributor

iapicca commented Jan 14, 2020

Hi @MilesAdamson
Are you still experiencing the issue with the latest stable version of Flutter?
If so, can you please provide your flutter doctor -v
and a reproducible minimal code sample?
Thank you

@iapicca iapicca added f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds and removed a: error message Error messages from the Flutter framework documentation labels Jan 14, 2020
@iapicca
Copy link
Contributor

iapicca commented Mar 20, 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.

Could everyone who still has this problem please file a new issue with the exact descriptions what happens, logs and the output of 'flutter doctor -v' please.
All system setups can be slightly different so it's always better to open new issues and reference related issues.

@iapicca iapicca closed this as completed Mar 20, 2020
@lock
Copy link

lock bot commented Apr 4, 2020

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.

@lock lock bot locked and limited conversation to collaborators Apr 4, 2020
@pedromassangocode pedromassangocode removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Dec 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

No branches or pull requests

4 participants