Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android activity Binary XML file line : You must supply a layout_width attribute

I've read about it already, but still it's here.

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
tools:context=".TaskEditActivity" >

So, the exception java.lang.RuntimeException: Binary XML file line #34: You must supply a layout_width attribute.

Attribute is there, schema too... Solution?

like image 891
Anton Chertash Avatar asked Jun 08 '13 11:06

Anton Chertash


3 Answers

Also i recommend check your dimens. You may have layout width in dimens, you go to it and you have value like "150" not "150dp" (missing dp) also cause this (that was my case)

like image 85
Jakub S. Avatar answered Sep 23 '22 21:09

Jakub S.


I had a dimension for a given width but it wasn't present in the default dimens.xml

res/    values-w320dp/           dimens.xml -> ring_radius=5dp    values/           dimens.xml -> missing ring_radius 
like image 45
Maragues Avatar answered Sep 21 '22 21:09

Maragues


It's clear. Child elements missed layout_width attribute.

like image 32
Anton Chertash Avatar answered Sep 19 '22 21:09

Anton Chertash