XML parsing error: unbound prefix with sdk toolbar 21

So I have installed the latest SDK 21 Lollipop. I had the icon action bar active and am trying to restore it with the new toolbar feature ... but it doesn't seem to work correctly. Basically I follow the information provided here

Basically, you need to instantiate the toolbar in the layout. I also:

<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.Toolbar
   xmlns:app="http://schemas.android.com/apk/res-auto" 
   android:id="@+id/myapp_toolbar"
   android:layout_height="wrap_content"
   android:layout_width="match_parent"
   android:minHeight="20"
   android:background="@drawable/action_bar_myapp" />

      

However, this is the creation and error message on the second line with the error "Error: Error parsing XML unrelated prefix".

When this error happens (for example here ), usually due to incorrect sintax, I copied / pasted the directiyl from the web page, also I did a simple test job. After removing all Android tags, the problem is still present.

This is probably something very simple, but I'm stuck. Any idea?

+3


source to share


1 answer


You must declare the namespace android.



<?xml version="1.0" encoding="utf-8"?> 
<android.support.v7.widget.Toolbar
   xmlns:android="http://schemas.android.com/apk/res/android"   
   xmlns:app="http://schemas.android.com/apk/res-auto" 
   ....
/>

      

+13


source







All Articles