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

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


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.