Inkscape settings for Android Vector Drawables

Android Vector Drawables are great for saving space, but when you ask for SVG files from designers, you almost inevitably get ones that aren’t formatted correctly for any of the Android tools to handle.

These are the critical settings that have to be done before you can drop the SVG into a tool like http://inloop.github.io/svg2android so you can get a vector drawable that you can use in your app:

  • the canvas has to be set to “px” in Inkscape
  • this canvas size should be the dp equivalent if you were to get them in bitmap form for your app! E.g., if you want assets that are 30dp x 30dp, you need to set Inkscape’s canvas size to 30px x 30px
  • If the SVG file has any vector objects, be sure to select all of them and do Path\ObjectToPath on them because Android only supports SVG paths

You’d think vectors are vectors and canvas size doesn’t matter, but it’s critical!

Show your support

Clapping shows how much you appreciated Ken Yee’s story.