locked
Error parsing XML: not well-formed (invalid token) RRS feed

  • Question

  • User386247 posted

    I'm having this issue with 2 of my layouts whenever i try to run my app, this is the code that i have for the first layout

    <include layout="@layout/content_main" />
                                                    -------------------->Error showing in this blank line
    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="bottom|end"
        android:layout_margin="@dimen/fab_margin"
        app:srcCompat="@android:drawable/ic_dialog_email" />
    
    <Button
        android:text="Resgistrar Estudiantes"
        android:layout_width="400px"
        android:layout_height="110px"
        android:layout_marginTop="250px"
        android:layout_marginLeft="180px"
        android:id="@+id/BtnRegEstudiante" />
    

    />

    And this is the one the i have for my second layout

    width="matchparent" android:layoutheight="matchparent" android:columnCount="2" android:rowCount="6" android:id="@+id/gridLayout1"

    * android:layout_width="120px" * --------Error showing in this line android:layout_height="100px" ad:minWidth="30px" ndroiandroid:minHeight="30px" android:paddingTop="60px" android:paddingLeft="20px" android:text="Nombre" android:textColor="@android:color/black" android:id="@+id/LblNombre"

    />
    
    <EditText
    android:id="@+id/TxtNombre"
    android:layout_width="285px"
    android:layout_height="100px"
    android:minWidth="30px"
    android:minHeight="30px"
    android:paddingTop="40px"
    android:paddingLeft="20px"
    android:layout_marginLeft="150px"
    />
    

    />

    Sunday, July 28, 2019 7:21 PM

Answers

  • User386247 posted

    I just found the error haha, i was missing a "="

       <Button
            android:id="@+id/BtnRegEstudiante"
            android:text="Registro de Estudiantes"
            android:layout_width="400px"
            android:layout_height="150px"
            android:layout_marginTop="250px"
            **android:layout_marginLeft="180px"/>**
    
    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, August 1, 2019 12:08 AM

All replies

  • User369979 posted

    For your second layout file, the controls should be placed in your GridLayout like:

    <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:columnCount="2"
        android:rowCount="6"
        android:id="@+id/gridLayout1">
    
        <!--... other children controls-->
    </GridLayout>
    

    For you first layout, please check whether content_main exists.

    Monday, July 29, 2019 2:42 AM
  • User386247 posted

    @LandLu said: For your second layout file, the controls should be placed in your GridLayout like:

    <GridLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:minWidth="25px"
        android:minHeight="25px"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:columnCount="2"
        android:rowCount="6"
        android:id="@+id/gridLayout1">
    
        <!--... other children controls-->
    </GridLayout>
    

    For you first layout, please check whether content_main exists.

    when i do that in the second layout, that section stops working

    Tuesday, July 30, 2019 12:04 AM
  • User369979 posted

    What do you mean that section stops working? I created a sample for referring. Please see the attachment for more details.

    Tuesday, July 30, 2019 9:52 AM
  • User386247 posted

    What i mean is that basically when i open and close like this

    <GridLayout 
        <!--... other children controls-->
    </GridLayout>
    

    the IDE is not recognizing that as a part of the code

    btw that sample is not letting me see the layouts :(

    Tuesday, July 30, 2019 11:55 PM
  • User369979 posted

    What do you mean sample is not letting me see the layouts? You can't open the second_layout in my sample?

    Wednesday, July 31, 2019 9:25 AM
  • User386247 posted

    Ok apparently it was an issue with my Visual Studio, i saw the file you sent, i edited some of my coded and part of it worked out for my, but the same issue is showing and this time that solution is not working :/

    <?xml version="1.0" encoding="utf-8"?>
    <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:app="http://schemas.android.com/apk/res-auto"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_height="match_parent">
    
        <android.support.design.widget.AppBarLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/AppTheme.AppBarOverlay">
    
            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                app:popupTheme="@style/AppTheme.PopupOverlay" />
    
        </android.support.design.widget.AppBarLayout>
    
        <include layout="@layout/content_main" />
    
        <android.support.design.widget.FloatingActionButton
            android:id="@+id/fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom|end"
            android:layout_margin="@dimen/fab_margin"
            app:srcCompat="@android:drawable/ic_dialog_email" />
    
            <Button
            android:id="@+id/BtnRegEstudiante"
            android:text="Registro de Estudiantes"
            android:layout_width="400px"
            android:layout_height="150px"
            android:layout_marginTop="250px"
            android:layout_marginLeft"180px"/>
    </android.support.design.widget.CoordinatorLayout>  The error is shown in this line
    
    Wednesday, July 31, 2019 11:36 PM
  • User386247 posted

    I just found the error haha, i was missing a "="

       <Button
            android:id="@+id/BtnRegEstudiante"
            android:text="Registro de Estudiantes"
            android:layout_width="400px"
            android:layout_height="150px"
            android:layout_marginTop="250px"
            **android:layout_marginLeft="180px"/>**
    
    • Marked as answer by Anonymous Thursday, June 3, 2021 12:00 AM
    Thursday, August 1, 2019 12:08 AM