RenderBox was not laid out Flutter / Dart Origin: On your device OSI layer 7 · Application Last updated 4 Nov 2026

Flutter: RenderBox was not laid out: RenderFlex#a1b2c relayoutBoundary=up2 NEEDS-PAINT — Failed assertion: 'hasSize'

A widget was asked for its size or painted before layout finished, usually because a parent gave it unbounded or conflicting constraints.

Exact message you may see RenderBox was not laid outFailed assertion: line 1930 pos 12: 'hasSize'RenderBox was not laid out: RenderFlex'package:flutter/src/rendering/box.dart': Failed assertion: 'hasSize'relayoutBoundary=up NEEDS-PAINT
Seen on: Flutter

Meaning

This is often a follow-on error: the first red error above it (unbounded height/width, infinite size) is the real cause. Fix that first. Typical triggers are a ListView/Column inside another scrollable or Row, or Expanded used outside a Flex parent.

Common causes

  • ListView or Column nested without bounded height
  • Expanded/Flexible inside a non-Flex parent
  • TextField or other box inside a Row without width constraint
  • Widget with no size placed in a Stack without Positioned
  • Cascade from an earlier layout exception

⚡ Quick fix

  1. Scroll up to the first exception in the log and fix that one
  2. Wrap the nested list in Expanded or SizedBox(height: …)
  3. Set shrinkWrap: true on an inner ListView when appropriate

Detailed fix by platform

Flutter

  1. Open DevTools → Flutter Inspector → Enable "Debug paint" to see which box has no size

How to diagnose

  1. First error — Which exception appears first?
  2. Parent — Bounded constraints?
  3. Widget — Expanded under Flex?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

A RenderFlex overflowed — Flutter: A RenderFlex overflowed by x pixels on the right/bottom (Flutter / Dart)A RenderFlex overflow…Android license status unknown / licenses not accepted — flutter doctor: Android license status unknown. Run `flutter doctor --android-licenses` to accept the SDK licenses (Flutter / Dart)Android license statu…BoxConstraints forces an infinite width — Flutter: BoxConstraints forces an infinite width. These invalid constraints were provided to RenderStack's layout() function (TextField in a Row) (Flutter / Dart)BoxConstraints forces…Cleartext HTTP traffic not permitted — Flutter (Android): java.io.IOException: Cleartext HTTP traffic to api.example.com not permitted (Flutter / Dart)Cleartext HTTP traffi…Dependency requires compileSdk 34 or later — Android Gradle: Execution failed for task ':app:checkDebugAarMetadata'. Dependency requires libraries and applications that depend on it to compile against version 34 or later of the Android APIs (Flutter / Dart)Dependency requires c…Incorrect use of ParentDataWidget — Flutter: Incorrect use of ParentDataWidget. The ParentDataWidget Expanded(flex: 1) wants to apply ParentData of type FlexParentData to a RenderObject (Flutter / Dart)Incorrect use of Pare…measured with an infinity maximum height — Jetpack Compose: Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed (Android)measured with an infi…There are multiple heroes that share the same tag — Flutter: There are multiple heroes that share the same tag within a subtree (Flutter / Dart)There are multiple he…RenderBox…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.