Binary XML file line #1: invalid drawable tag vector

Documentation about Vector Graphics says: Android 4.4 (API level 20) and lower doesn’t support vector drawables. With Support Library you have backward-compatibility using the attribute app:srcCompat, but it is not backported for android:drawableRight. The solution is to keep using .PNG files for those cases or try to set it by code.

How to use vector drawables with View besides ImageView with srcCompat?

Update 2: They have added an option to enable it again in Support Library 23.4.0: For AppCompat users, we’ve added an opt-in API to re-enable support Vector Drawables from resources (the behavior found in 23.2) via AppCompatDelegate.setCompatVectorFromResourcesEnabled() – keep in mind that this still can cause issues with memory usage and problems updating Configuration instances, …

Read more

Invalid drawable tag vector

Got this problem too when loading vectors from a selector on pre-lollipop devices: Use AppCompatDelegate.setCompatVectorFromResourcesEnabled(true) in your onCreate method: Sets whether vector drawables on older platforms (< API 21) can be used within resources. When enabled, AppCompat can intercept some drawable inflation from the framework, which enables implicit inflation of vector drawables within …

Read more

Android vectorDrawables.useSupportLibrary = true is stopping app

You cannot use Vector Drawables in any other views except ImageView in pre-lollipop. Please see this SO Answer by google developer advocate. For AppCompat users, we’ve decided to remove the functionality which let you use vector drawables from resources on pre-Lollipop devices due to issues found in the implementation in version 23.2.0/23.2.1 [, …

Read more

How to change color of vector drawable path on button click

The color of the whole vector can be changed using setTint. You have to set up your ImageView in your layout file as this: <ImageView android:id=”@+id/myImageView” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:tint=”@color/my_nice_color” android:src=”” android:scaleType=”fitCenter” /> Then to change the color of your image: DrawableCompat.setTint(myImageView.getDrawable(), ContextCompat.getColor(context, R.color.another_nice_color)); Note: myImageView.getDrawable() gives nullpointerexception if the vector drawable is set to the …

Read more

SplashScreen with Vector stretched full screen

I stumbled upon the same problem. Unfortunately there does not seem to be a possibility to make the splash screen work with just a vector drawable for pre API 23. The problem is you can’t load VectorDrawableCompat outside of the process, like in this case in your themes android:windowBackground. So what is likely happening here …

Read more