How to create Android VectorDrawables from Illustrator (or similar tool)? How to create Android VectorDrawables from Illustrator (or similar tool)? android android

How to create Android VectorDrawables from Illustrator (or similar tool)?


If you're using Android Studio, the best method is:

  • Right-click on your 'drawable' folder > New > Vector Asset
  • Click 'Local SVG file' to import your own SVG file, or 'Material Icon' to use the supplied icons.
  • Change the resource name to whatever you need it to be.
  • Click Next and choose your target modules and res directory.
  • Click Finish.

The wizard produces XML from your SVG files.


That tool only appears to currently support <path> elements. So for example it doesn't support <rect>, <circle> etc.

If you are using primitives like this in your drawing, you need to convert them. I forget the exact option you need to use, but it's probably something like "Convert to path".

This link may help.

https://graphicdesign.stackexchange.com/questions/15475/convert-primitive-to-path-using-svg-format-in-illustrator


Just use SVG to VectorDrawable Converter or its online version. This is a batch converter of SVG images to Android VectorDrawable XML resource files.

Link points to readme, which provide enough information on how to use the converter.