Convert SVG to Android VectorDrawable

By the Axialis Engineering team ·

Convert SVG to Android VectorDrawable

Android Studio's Vector Asset Studio only imports a subset of SVG, so icons with filters, masks, or stray transforms either fail to import or render wrong as a VectorDrawable. This guide gets you a clean import: export a minified, paths-only SVG from Axialis IconVectors, run it through Vector Asset Studio to generate a VectorDrawable XML, and add PNG fallbacks only where a legacy target needs them.

Prep your SVG for Android

  1. Open or create your icon in IconVectors:
    • File → Open… (Ctrl+O) or New Icon (Ctrl+N).
    • Design on a square grid (e.g., 24×24) and keep shapes crisp at small sizes.
    A single-color icon open in the IconVectors editor on a 24x24 pixel grid, ready to export as SVG
    Keep it simple: paths and strokes are fine; avoid filters, masks, and heavy effects.
  2. Flatten & simplify (as needed)
    • Remove filters/masks/clipping. Vector Asset Studio imports a subset of SVG.
    • If you used complex strokes (dashes, wide outlines), consider converting them to filled paths for predictable results.
    • Ensure the root has a clean viewBox (e.g., 0 0 24 24).
  3. Export Minified SVG

    Choose File → Export → Export Minified (Shift+Ctrl+M) and save ic_check_24.svg. This strips metadata and preserves the geometry.

Import with Vector Asset Studio (Android Studio)

  1. Open Vector Asset Studio
    • Resource Manager → + → Vector Asset, then pick Local file (SVG) and select your exported SVG.
    • Or use File → New → Vector Asset from the Project view.
  2. Review the preview & name
    • Set a descriptive name (e.g., ic_check_24) and verify the tint/fill if you rely on a single color.
    • Fix warnings: simplify gradients, remove unsupported attributes, or re-export with strokes outlined.
  3. Finish to generate a VectorDrawable

    Android Studio creates res/drawable/ic_check_24.xml. A minimal VectorDrawable looks like this:

    <vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="24dp"
        android:height="24dp"
        android:viewportWidth="24"
        android:viewportHeight="24">
      <path
          android:fillColor="#000"
          android:pathData="M4,12 L9,17 L20,6" 
          android:strokeColor="#000"
          android:strokeWidth="2" 
          android:fillAlpha="0" />
    </vector>

Use the drawable in layouts

Optional: PNG fallbacks

Related guides

Start Making SVG Icons Today with IconVectors

Download the fully-functional 30‑Day Free Trial and unlock your icon design workflow.

Version 1.70 for Windows and macOS