"Unexpected prefix namespace 'android' found..." error


#1

Hi, I am starting the first Android app, and I compiled the code just like the book said, but a bunch of red crosses showed up on my activity_quiz.xml file. All of them are the same, they say: “Unexpected prefix namespace ‘android’ found for tag TextView”.

I have 5 altogether. 2 that say “TextView”, one that says “LinearLayout”, and 2 that say “tag Button”.

The only clue might be my strings.xml file. When I created it, the book said don’t delete the < string name =" menu_settings" > Settings </ string > line… but my code never had that line. It had a different line instead: <string name="action_settings">Settings</string>

So my guess is there is a version difference here going on that the book was not written for (maybe it is too old to know the newer ways).

Here is my code from activity_quiz.xml:

[code]

<TextView 
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:padding="24dp"
    android:text="@string/question_text" />

<LinearLayout
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal" >
    
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/true_button" />
    
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/false_button" />

</LinearLayout>

[/code]


#2

UPDATE: I found an extra “t” in the top http:// declaration. I deleted it, but then nothing happened. Then I SAVED my project and all the error messages went away. Going to make sure I save more often in the future! Odd that that works, other code compiler software fixes right away when you correct an error.