Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio error using VectorDrawable (the new Support 23.2.0 library)

When adding a VectorDrawable as the src of my ImageView using the new Support Library 23.2

app:srcCompat="@drawable/ic_like"

I get the app to compile successfully and the vector drawable to show correctly. But, Android studio showing me an error saying:

Unexpected namespace prefix "app" found for tag ImageView

Any advise on how to fix it? or is it just a bug and should be ignored?

EDIT:

Forgot to mention that i have added the xmlns:app="http://schemas.android.com/apk/res-auto" declaration

like image 672
TareK Khoury Avatar asked Feb 25 '16 08:02

TareK Khoury


2 Answers

Seems like it is just a lint error that can be ignored. I have updated and have the same error, but it is working correctly.

An Android Studio update will probably fix this. I am running the latest Canary build, which contains the same error currently.

like image 124
James Britton Avatar answered Nov 11 '22 18:11

James Britton


It is a little worse than just an error message. In my case, it also prevents proper rendering of the image in Studio's Design mode.

Update: Fixed in Android Studio version 2.1

like image 37
Michael Updike Avatar answered Nov 11 '22 18:11

Michael Updike