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.

What VectorDrawable does not support

Vector Asset Studio imports only a subset of SVG. Anything outside it is dropped, rasterized, or flagged with a warning, so remove or convert these before you export:

IconVectors export vs Android Studio import

The two tools split the work. IconVectors produces a clean, importable SVG; Vector Asset Studio turns it into the platform XML.

Task In IconVectors (before) In Android Studio (on import)
Unsupported featuresRemove filters, masks, text, and patterns; outline dashed strokes.Warns and drops or mis-renders anything left over.
GeometryExport a minified, paths-only SVG with a clean viewBox.Maps the viewBox to viewportWidth/Height and a dp size.
ColorSet a single fill or currentColor.Becomes android:fillColor; tint at runtime with android:tint.
OutputOne .svg source you keep as the master.res/drawable/ic_*.xml VectorDrawable.

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

Adaptive launcher icons

App launcher icons on Android 8.0 (API 26) and up are adaptive: a foreground and a background layer that the launcher can mask into different shapes. A VectorDrawable works as either layer. Each layer is 108x108dp, and the outer edges are used for the mask and motion, so keep the key artwork within the central 66dp-diameter safe zone or it can be clipped. The same safe-zone idea drives web app icons; see PWA maskable icons for the browser equivalent.

Other conversions

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, macOS, and Linux