Inspectopedia Help

Missing layout_width or layout_height attributes

Missing layout_width or layout_height attributes

All views must specify an explicit layout_width and layout_height attribute. There is a runtime check for this, so if you fail to specify a size, an exception is thrown at runtime.

It's possible to specify these widths via styles as well. GridLayout, as a special case, does not require you to specify a size.

Issue id: RequiredSize

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for Android 2023.3, Qodana for JVM 2023.3

Plugin:

Android, 2022.3.1 Beta 2

Last modified: 13 July 2023