error: Error parsing XML: not well-formed (invalid token) ...?

Usama Sarwar picture Usama Sarwar · Aug 17, 2011 · Viewed 184.1k times · Source

I am working on an application, with following XML. but whenI try to clean/build my project the following error occurs:

"error: Error parsing XML: not well-formed (invalid token)"

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<TextView  
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:text="@string/hello";
/>
</LinearLayout>

What does it possibly mean?

Answer

Rock Lee picture Rock Lee · Jan 23, 2016

I had this problem, and when I had android:text="< Go back" it had the correct syntax highlighting, but then I realized it's the < symbol that is messing everything up.