locked
Why do I get this error? Android.Views.InflateException: RRS feed

  • Question

  • User196747 posted

    Android.Views.InflateException: Binary XML file line #1: Binary XML file line #1: You must supply a layoutwidth attribute. Text of the AXML is attached. I have read extensively online. What I see is either the Layout width IS missing, or this is being used as a catchall error of some kind. I don't see any missing layoutwidth statements so I am guessing it is some other obscure syntax error. Help I have been stuck on this one for quite a while.

    Tuesday, June 7, 2016 9:05 PM

Answers

  • User60257 posted

    Is it the same error, as there is no layout_height on the last table row.

    If that doesn't work have you tried commenting out most of the code, then adding it back in item by item until you see what is causing the error? Bit of a longwinded way but should allow you to find the issue.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, June 10, 2016 2:14 AM
  • User196747 posted

    Finally got it, last TableLayout had no length or width. Seems this would be a simple process if the error message provided an accurate line number for the error. Thanks for the help.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, June 10, 2016 5:16 PM

All replies

  • User60257 posted

    Your table rows don't have a width set.

    Wednesday, June 8, 2016 3:42 AM
  • User196747 posted

    I have added TableRow Layout_Width's and get the same result. The new AXML is attached.

    Thursday, June 9, 2016 4:14 PM
  • User60257 posted

    Is it the same error, as there is no layout_height on the last table row.

    If that doesn't work have you tried commenting out most of the code, then adding it back in item by item until you see what is causing the error? Bit of a longwinded way but should allow you to find the issue.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, June 10, 2016 2:14 AM
  • User196747 posted

    Finally got it, last TableLayout had no length or width. Seems this would be a simple process if the error message provided an accurate line number for the error. Thanks for the help.

    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Friday, June 10, 2016 5:16 PM
  • User351573 posted

    @JimBennett Having the same issue, all layout have layoutheight and layoutwidth: Please help me to find the issue.

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="#FFCDD2"
        android:orientation="vertical">
        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_name"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <EditText
                android:id="@+id/input_name"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:singleLine="true"
                android:hint="@string/hint_name" />
        </android.support.design.widget.TextInputLayout>
        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_email"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <EditText
                android:id="@+id/input_email"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="textEmailAddress"
                android:hint="@string/hint_email" />
        </android.support.design.widget.TextInputLayout>
        <android.support.design.widget.TextInputLayout
            android:id="@+id/input_layout_password"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <EditText
                android:id="@+id/input_password"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:inputType="textPassword"
                android:hint="@string/hint_password" />
        </android.support.design.widget.TextInputLayout>
        <Button
            android:id="@+id/btn_signup"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/btn_sign_up"
            android:background="@color/colorPrimary"
            android:layout_marginTop="40dp"
            android:textColor="@android:color/white" />
    </LinearLayout>
    
    Saturday, March 17, 2018 2:13 PM
  • User351573 posted

    Update: Issue is with theme :)

    Forget to add Theme.AppCompat theme for my activity, solved it by following steps:

    Create a styles.xml file under Resources\values\ folder with below codes:

    <?xml version="1.0" encoding="utf-8" ?> 
    <resources>
     <!-- Base application theme. -->
        <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
        </style>
    </resources>
    

    In MainActivity.cs define the Activity attribute to leverage AppTheme like this:

    [Activity(Label = "DinexFeedback", MainLauncher = true, Icon = "@drawable/icon",Theme ="@style/AppTheme")]
    public class MainActivity : Android.Support.V7.App.AppCompatActivity
    {
       ...
    }
    
    Monday, March 19, 2018 10:54 AM