55
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?

Arka Prava Basu
  • 2,366
  • 3
  • 18
  • 34
  • The svg was not created properly. Unfortunately I do not have the details, have to contact the designer who resolved the issue for me :P. Will update when I can. – Arka Prava Basu Nov 09 '18 at 05:40
  • how did he fix it ? – ir2pid Nov 26 '18 at 15:44
  • 2
    hmm, so my designer said he converted all texts to curves. – ir2pid Nov 26 '18 at 15:57
  • 3
    She converted all vector images into outline(s) and this problem was resolved. – Arka Prava Basu Dec 05 '18 at 03:07
  • 3
    I had the same problem with the `svg` exported by Adobe XD. In Adobe XD I needed to right-click on the text and select Path -> Convert to Path option. – kojot Dec 02 '19 at 14:44
  • 5
    You need to convert text to paths, I've just tried it & it works fine, I voted for re-opening this question to put a detailed answer because this question is really different from the mentioned duplicate which is about ! – AbdelHady Dec 24 '19 at 12:51
  • @karel, great, thanks for your mention, I've just added my answer – AbdelHady Apr 03 '20 at 16:04

7 Answers7

82

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.

AbdelHady
  • 9,334
  • 8
  • 56
  • 83
19

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).
9

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

Aldan
  • 674
  • 9
  • 23
SeanyMc
  • 425
  • 5
  • 10
4

If you are using adobe illustrator, Set 'font' to 'convert to outlines'...worked for me

Wise
  • 41
  • 1
  • 2
3

If you are using Sketch select the text and do "Convert to Outlines" will work.

ajw
  • 2,568
  • 23
  • 27
1

Well, this method is perfect for splash screen logo where you've got both image + text.

When you have got both image + text and you export them as SVG file and import in android drawable as vector then only image shows up with no text.

If you're struggling with the same issue then here's a way to add a text into your SVG file. Here's how:

  1. Firstly, you need have Adobe illustrator installed in your machine.
  2. Next, when you'll add a text + image or simply a text and done with all the customizations then select all and go to Objects > Expand > ok.
  3. That's all. Now simply export your media as SVG file and you are ready to go.
0

Select your text in Adobe Illustrator and right-click, then click on Create Outlines.

Ziad H.
  • 528
  • 1
  • 5
  • 20