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:
- [In Inkscape] Select text block.
- [In Inkscape] Menu "Path | Object To Path"
- Save as "Inkscape SVG"
- [Android Studio] Import SVG ("Right-click on app/res/drawable" | "New Vector Asset" and select file saved in (3).
Solution 3:
In Adobe XD
- Select text
- Go to
Object
->Path
->Convert to Path
.
OR Select text and CTRL
+ 8
for Windows or ⌘
+ 8
for macOS