Unsupported SVG Features in Android VectorDrawables

Android’s VectorDrawable format provides a lightweight way to render vector graphics across different screen densities, but it only supports a subset of the full Scalable Vector Graphics (SVG) specification. When converting SVGs into VectorDrawable XML files using Android Studio’s Vector Asset Studio or third-party converters, several advanced tags, styling rules, and visual effects are ignored, stripped, or cause import errors. This guide outlines the SVG elements and attributes that are unsupported in Android VectorDrawables and how to adjust your assets for compatibility.

Unsupported SVG Elements

VectorDrawables are primarily designed for simple icons and shapes rendered via path data. The following SVG elements are completely unsupported or severely restricted:

1. Text Elements

2. Complex Structure and Reusability Tags

3. Filters and Visual Effects

4. Embedded Media and Patterns

5. Masking and Advanced Clipping

6. Interactive and Dynamic Tags


Unsupported SVG Attributes and Styling

Even within supported elements (like <path>, <rect>, <circle>, or <g>), specific attributes and formatting methods cannot be directly translated into VectorDrawable properties.

1. CSS Styles and Selectors

2. Relative and Non-Standard Units

3. Gradient Configurations

4. Non-Uniform Transformations


Summary of Best Practices for Conversion

To ensure an SVG converts seamlessly to an Android VectorDrawable:

  1. Outline all text: Convert all typography to vector paths.
  2. Flatten layers and remove styles: Expand all strokes where necessary, remove global <style> tags, and apply colors directly as element attributes.
  3. Remove filters: Strip all blurs, drop shadows, and clipping masks before exporting.
  4. Group transforms: Wrap paths in <g> tags if they require rotation, translation, or scaling.
  5. Clean the SVG: Run the graphic through an optimizer such as SVGO to remove metadata, comments, and unsupported tags.