Whenever I create an ImageView with icon added using Android Studio's Vector Assets, I'm getting an error at the line app:srcCompat="@drawable/ic_play"
When I change the app:srcCompat
with android:src
, the error is gone but the icon looks pixelated.
What is the main difference between
app:srcCompat="@drawable/ic_play"
and
android:src="@drawable/ic_play"
app:srcCompat
Note
As of Android Support Library 23.3.0, support vector drawables can only be loaded via
app:srcCompat
.you need to add vectorDrawables.useSupportLibrary = true to your
build.gradle
fileandroid:src