AppCompat 23.3 Support Vectors no longer work?

Update: They enable it again in Support Library 23:

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(true); – keep in mind that this still can cause issues with memory usage and problems updating Configuration instances, hence why it is disabled by default.

Check this link: 23.4.0 available now

———————————————————–

As per the release announcement for Android Support Library 23.3:

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 [ https://code.google.com/p/android/issues/detail?id=205236, https://code.google.com/p/android/issues/detail?id=204708 ]. Using app:srcCompat and setImageResource() continues to work.

So this is an expected behavior change. You’ll have to use non-vector graphics for any case not handled by srcCompat.

If you’d like to continue to use vectors prior to API 21, you can remove the line

vectorDrawables.useSupportLibrary = true

(or the equivalent if you using the 1.5 Gradle plugin as shown in the 23.2 blog post).

This will cause Android Studio to generate PNGs at compile time for apps with a minSdkVersion less than API 21 while using your vectors on API 21+ devices, allowing you to keep the same code as with 23.2.1 at the cost of additional APK size.

Leave a Comment