Hans Lepoeter
Hans Lepoeter

Reputation: 149

Vector Asset Studio exception parsing xml

I have an svg file (vector graphics) which opens fine in Internet Explorer, but fails when opening in Vector Asset studio (part of android studio) with:

For input string: 2.85465in Exception while parsing XML file:

I think this is caused by the decimal point, where a comma is expected as the computer used has Dutch settings and "," is expected to be the decimal separator.

Where does Vector asset studio gets it's information for this and can it be changed locally?

Upvotes: 0

Views: 2459

Answers (3)

Braian Coronel
Braian Coronel

Reputation: 22907

With this error in Vector Asset:

Could not generate a preview
Exception while parsing XML file:
Premature end of file.

My provisional solution was:

  1. Before getting the .svg file, I generated a .png with Photoshop CC.
  2. I converted my .png to .svg with a converter
  3. Verify that my .svg can be converted to VectorDrawable. This is to know if the Android Studio Vector Asset will be able to perform the conversion.
  4. And finally, I select the VectorDrawable XML that I generated when I checked and paste a resource into the drawable directory, or I use New-> Vector Asset to generate this resource from my verified .svg.

With check I mean make sure the .svg will be parsed to xml with Vector Asset.

So I observed this error occurs when the image has tiny text and when using the .svg converter is likely to skip it.

Upvotes: 1

m02ph3u5
m02ph3u5

Reputation: 3161

Try removeing the in or replace it by px. Asset Studio doesn't seem to work with any other size declaration than px.

There was a conversation on google groups, I think, that I recently read. Took the solution from there. Will add the link if I find it again.

// edit: found it: https://code.google.com/p/android/issues/detail?id=189654

Upvotes: 0

frogatto
frogatto

Reputation: 29285

SVG files are just text files, you can open them in any text editor (like notepad) and change their content as you like.

Upvotes: 0

Related Questions