Android Vector Drawable <text> not support, <tspan> not support

In icon.svg
ERROR@ line 9 <text> is not supported
ERROR@ line 10 <tspan> is not supported

How to export this type of svg to vector drawable? Is this even possible? Or should I look for a new svg?


Solution 1:

When I had the same issue, I used the free online converter CloudConvert, to convert my SVG to another SVG, with marking their setting Text To Path to yes, where the converted SVG got opened in my Android Studio like a charm.

Solution 2:

If anyone got here because their Inkscape SVG with text imported into Android produced same error (and didn't show text), then be sure in Inkscape to convert the text to path using "Object to path" menu:

  1. [In Inkscape] Select text block.
  2. [In Inkscape] Menu "Path | Object To Path"
  3. Save as "Inkscape SVG"
  4. [Android Studio] Import SVG ("Right-click on app/res/drawable" | "New Vector Asset" and select file saved in (3).

Solution 3:

In Adobe XD

  1. Select text
  2. Go to Object -> Path -> Convert to Path.

OR Select text and CTRL + 8 for Windows or + 8 for macOS