VectorDrawableCompat reports "invalid drawable tag vector"

57 views
Skip to first unread message

Friedrich Horschig

unread,
Jun 25, 2018, 1:32:28 PM6/25/18
to chromi...@chromium.org
Hi everyone,
Is there a canonical way to use vector Drawables in Chrome?

Currently, I am loading an existing resource with VectorDrawableCompat.create but this doesn't seem to work on Kitkat and earlier versions, resulting in a wide-spread crash: https://crbug.com/856175

So far, I couldn't find any other approaches to loading a Drawable and everything that internal sources and stackflow mention as fix is just to use vectorDrawables.useSupportLibrary = true (which is done in Chromium) or to use weird hacks with selectors. But we do use vector icons without these hacks, so what's the right way to do it?

Cheers,
Friedrich

fhor...@chromium.org

unread,
Jun 27, 2018, 7:20:30 AM6/27/18
to Chromium-dev
FTR: This might be a bug in the support library. The proposed fix was to use |AppCompatResources.getDrawable| instead of |VectorDrawableCompat.create|.
Reply all
Reply to author
Forward
0 new messages