Ankit HTech
Ankit HTech

Reputation: 1893

Error in XML Layout in android

Error in below xml

<?xml version="1.0" encoding="utf-8"?>
<!-- row.xml -->
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent" android:layout_height="45dp"
    android:gravity="center" android:background="@color/list_bg">

    <TableLayout android:layout_width="fill_parent"
        android:layout_height="wrap_content">

        <TableRow>

            <ImageView android:id="@+id/t1" android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

            <TextView android:id="@+id/t2" android:typeface="normal"
                android:singleLine="true" android:textSize="14sp" android:textStyle="normal"
                android:layout_width="wrap_content" android:textColor="#000000"
                android:layout_height="wrap_content" />
            <TextView android:id="@+id/t10" android:typeface="normal"
                android:singleLine="true" android:text=" " android:textSize="14sp"
                android:textStyle="normal" android:layout_width="wrap_content"
                android:textColor="#000000" android:layout_height="wrap_content" />
            <TextView android:id="@+id/t4" android:typeface="normal"
                android:visibility="gone" android:singleLine="true" android:text="("
                android:textSize="14sp" android:textStyle="normal"
                android:layout_width="wrap_content" android:textColor="#000000"
                android:layout_height="wrap_content" />
            <TextView android:id="@+id/t5" android:typeface="normal"
                android:visibility="gone" android:singleLine="true"
                android:textSize="14sp" android:textStyle="normal"
                android:layout_width="wrap_content" android:textColor="#000000"
                android:layout_height="wrap_content" />
            <TextView android:id="@+id/t6" android:typeface="normal"
                android:visibility="gone" android:singleLine="true" android:text=")"
                android:textSize="14sp" android:textStyle="normal"
                android:layout_width="wrap_content" android:textColor="#000000"
                android:layout_height="wrap_content" />
            <ImageView android:id="@+id/t3" android:layout_width="wrap_content"
                android:layout_height="wrap_content" />

        </TableRow>

    </TableLayout>

</RelativeLayout>

Error is:

Multiple annotations found at this line: - The processing instruction target matching "[xX][mM][lL]" is not allowed. - No grammar constraints (DTD or XML schema) detected for the document.

Please help...

Upvotes: 1

Views: 2905

Answers (3)

Royston Pinto
Royston Pinto

Reputation: 6721

Not seeing any error when copied to my eclipse. Using Eclipse Juno and SDK 20, ADT version 20.0.1

Upvotes: 1

Ankit HTech
Ankit HTech

Reputation: 1893

I found my mistake there was a extra line before first line of my xml I have removed it and now its working fine.

Upvotes: 2

Krishnabhadra
Krishnabhadra

Reputation: 34265

1) Make sure you don't have any comment or white space or empty line before

<?xml version="1.0" encoding="utf-8"?>

That declaration should be on top

Upvotes: 4

Related Questions