Top Picks

Movies by Flixster

4.5950646

 

FREE
   
February 16, 2013

 

Unexpected namespace prefix “xmlns” found for tag LinearLayout

 

I am having an error in following xml file. “Unexpected namespace prefix “xmlns” found for tag LinearLayout”. I tried the solutions provided in other similar questions also but it didnt work for me. Same error is occuring in 3 lines where there is LinearLayout is used.

<?xml version="1.0" encoding="utf-8"?> <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@drawable/background" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical" > <TextView android:id="@+id/menu_top_text" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/name_version" android:textSize="20sp" android:textColor="@color/black" /> <LinearLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:orientation="horizontal" > </LinearLayout> <!-- A horizontal line --> <FrameLayout android:layout_height="30px" android:layout_width="fill_parent" > </FrameLayout> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="wrap_content" android:gravity="center_horizontal" android:orientation="vertical" > <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_height="wrap_content" android:layout_width="fill_parent" android:orientation="horizontal" android:gravity="center" > <Button android:id="@+id/start_stop_button" android:layout_height="74dp" android:layout_width="74dp" android:text="@string/start_server" /> <Button android:id="@+id/instructions" android:layout_width="120dp" android:layout_height="74dp" android:text="@string/instructions_label" /> <Button android:id="@+id/setup" android:layout_height="74dp" android:layout_width="74dp" android:text="@string/setup_label" /> </LinearLayout> </LinearLayout> <FrameLayout android:layout_height="30px" android:layout_width="fill_parent" > </FrameLayout> <!-- A horizontal line --> <FrameLayout android:layout_height="1px" android:layout_width="fill_parent" android:background="#666666" > </FrameLayout> <FrameLayout android:layout_height="10px" android:layout_width="fill_parent" > </FrameLayout> <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:shrinkColumns="2"> <TableRow> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/server_status" android:textSize="16sp" android:textColor="@color/black" android:gravity="left" /> <!--A small spacer between the columns --> <FrameLayout android:layout_width="3sp" android:layout_height="wrap_content" /> <TextView android:id="@+id/server_status" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/unknown" android:textColor="@color/black" android:textSize="16sp" /> </TableRow> </TableLayout> <FrameLayout android:layout_height="10px" android:layout_width="fill_parent" > </FrameLayout> <!-- A horizontal line --> <FrameLayout android:layout_height="1px" android:layout_width="fill_parent" android:background="#666666" > </FrameLayout> <FrameLayout android:layout_height="10px" android:layout_width="fill_parent" > </FrameLayout> <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:shrinkColumns="2"> <TableRow> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/my_url_is" android:textSize="16sp" android:gravity="left" android:textColor="@color/black" /> <!--A small spacer between the columns --> <FrameLayout android:layout_width="3sp" android:layout_height="wrap_content" /> <TextView android:id="@+id/ip_address" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/no_url_yet" android:textSize="16sp" android:textColor="@color/black" /> </TableRow> <TableRow> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/wifi_status" android:textSize="16sp" android:gravity="left" android:textColor="@color/black" /> <!--A small spacer between the columns --> <FrameLayout android:layout_width="3sp" android:layout_height="wrap_content" /> <TextView android:id="@+id/wifi_status" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/unknown" android:textSize="16sp" android:textColor="@color/black" /> </TableRow> <TableRow> <TextView android:id="@+id/last_error_label" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/last_error" android:textSize="16sp" android:gravity="left" android:visibility="gone" /> <!--A small spacer between the columns --> <FrameLayout android:layout_width="3sp" android:layout_height="wrap_content" /> <TextView android:id="@+id/last_error" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/unknown" android:textColor="#ff0000" android:textSize="16sp" android:visibility="gone" /> </TableRow> </TableLayout> <FrameLayout android:layout_height="10px" android:layout_width="fill_parent" > </FrameLayout> <!-- A horizontal line --> <FrameLayout android:layout_height="1px" android:layout_width="fill_parent" android:background="#666666" > </FrameLayout> <!-- <TextView android:id="@+id/proxy_header" android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/proxy_experimental" android:textSize="16sp" />--> <TableLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:shrinkColumns="2"> <TableRow> <!-- <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/proxy_status" android:textSize="16sp" android:gravity="left" /> --> <!--A small spacer between the columns --> <FrameLayout android:layout_width="3sp" android:layout_height="wrap_content" /> </TableRow> <TableRow> <!--A small spacer between the columns --> <FrameLayout android:layout_width="3sp" android:layout_height="wrap_content" /> </TableRow> <TableRow> <!--A small spacer between the columns --> <FrameLayout android:layout_width="3sp" android:layout_height="wrap_content" /> </TableRow> <TableRow> <!--A small spacer between the columns --> <FrameLayout android:layout_width="3sp" android:layout_height="wrap_content" /> </TableRow> </TableLayout> <!-- A horizontal line --> <FrameLayout android:layout_height="1dp" android:layout_width="fill_parent" android:background="#666666" > </FrameLayout> <!-- A horizontal line --> <FrameLayout android:layout_height="1dp" android:layout_width="fill_parent" android:background="#666666" > </FrameLayout> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/server_log" android:textColor="#ffffff" /> <CheckBox android:id="@+id/server_log_checkbox" android:layout_height="wrap_content" android:layout_width="wrap_content" android:checked="false" /> </LinearLayout> <TextView android:id="@+id/server_log" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#333333" /> <!-- A horizontal line --> <FrameLayout android:layout_height="1dp" android:layout_width="fill_parent" android:background="#666666" android:visibility="gone" > </FrameLayout> <LinearLayout android:orientation="horizontal" android:layout_width="fill_parent" android:layout_height="wrap_content" android:visibility="gone"> <TextView android:layout_height="wrap_content" android:layout_width="wrap_content" android:text="@string/session_monitor" android:textColor="#ffffff" android:visibility="gone" /> <CheckBox android:id="@+id/session_monitor_checkbox" android:layout_height="wrap_content" android:layout_width="wrap_content" android:checked="false" android:visibility="gone" /> </LinearLayout> <TextView android:id="@+id/session_monitor" android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="#333333" android:visibility="gone" /> <!-- A horizontal line --> <FrameLayout android:layout_height="1dp" android:layout_width="fill_parent" android:background="#666666" > </FrameLayout> <!-- It's visually pleasing to have some empty space at the bottom --> <FrameLayout android:layout_height="15dp" android:layout_width="fill_parent" /> </LinearLayout> </ScrollView>

 

Answer

Please try following:

1.Remove “?xml version=”1.0″ encoding=”utf-8″?” line from the top.

2.Remove “xmlns:android=”http://schemas.android.com/apk/res/android” from all the place excluding the ScrollView. I believe it is sufficient to inform it to the application once.

Professional Hosting fro Just Host

Filed under: Android Coding FAQ

Tags:

Comments

No Comments

Leave a reply