Status Update
Comments
xa...@android.com <xa...@android.com>
zt...@google.com <zt...@google.com> #3
Honestly, 100% width is a relative concept, it is better to supply a px size here.
Anyway, I fix my tool to infer from the viewbox size to interpret the 100% width / height.
Anyway, I fix my tool to infer from the viewbox size to interpret the 100% width / height.
pe...@awesome39.com <pe...@awesome39.com> #4
[Comment deleted]
pe...@awesome39.com <pe...@awesome39.com> #5
Same error with the following message:
Empty preview image!
EXCEPTION in parsing FLASHinFLASKv0.1.svg:
For input string: "297mm"Exception while parsing XML file:
Premature end of file.
My version is 1.5.1
Empty preview image!
EXCEPTION in parsing FLASHinFLASKv0.1.svg:
For input string: "297mm"Exception while parsing XML file:
Premature end of file.
My version is 1.5.1
je...@gmail.com <je...@gmail.com> #6
I'm also getting an error with my SVG:
Empty preview image!
EXCEPTION in parsing icon_donut_vector.svg:
For input string: "256.000000pt"Exception while parsing XML file:
Premature end of file.
Android Studio 1.5.1 (screenshot of details attached)
Mac OS X 10.9.5 (screenshot of details attached)
Empty preview image!
EXCEPTION in parsing icon_donut_vector.svg:
For input string: "256.000000pt"Exception while parsing XML file:
Premature end of file.
Android Studio 1.5.1 (screenshot of details attached)
Mac OS X 10.9.5 (screenshot of details attached)
zt...@google.com <zt...@google.com>
as...@gmail.com <as...@gmail.com> #7
Drawn svg with inkscape. Trying to use in android studio and getting error as
Empty preview image!
EXCEPTION in parsing cup_image.svg:
For input string: "297mm"Exception while parsing XML file:
Premature end of file.
Please help
Empty preview image!
EXCEPTION in parsing cup_image.svg:
For input string: "297mm"Exception while parsing XML file:
Premature end of file.
Please help
ap...@gmail.com <ap...@gmail.com> #8
I used to get the "For input string: 980mm Exception" with all my Inkscape generated SVGs. I came around with this solution until Google provides a permanent fix. I use Inkscape 0.91, so this may be different for others.
>> You can try to open your SVG file with a text editor and manually delete the "mm" part on your height="980mm" and width="980mm". This worked for importation but caused rendering errors on my icons.
>> To correctly render the SVG file, I had to recreate it from scratch, but with the page set on one of its Icon sizes. There are three of them Icon 16x16, Icon 32x32 and Icon 48x48. You can do this by going to File > Document properties > Page > Page size.
>> Once you’ve recreated your SVG, be sure to save it as an "Optimized SVG", and use the following options on the dialog that pops up.
>Options Tab:
-Tic Shorten color values
-Tic Convert CSS attributes to XML attributes
-Tic Group collapsing
-Tic Remove metadata
-Tic Remove comments
-Tic Work around render bugs
-Tic Remove the xml declaration
-Number of significant digits for cords: 5
-XML indentation (pretty-printing): None
>Ids Tab:
-Tic Remove unused ID names for elements
-Tic Shorten IDs
>> One last tip: avoid using strokes on your SVG images. Most of the rendering problems I encountered were solved by merging the strokes with the Fill area. Hope this helps.
>> You can try to open your SVG file with a text editor and manually delete the "mm" part on your height="980mm" and width="980mm". This worked for importation but caused rendering errors on my icons.
>> To correctly render the SVG file, I had to recreate it from scratch, but with the page set on one of its Icon sizes. There are three of them Icon 16x16, Icon 32x32 and Icon 48x48. You can do this by going to File > Document properties > Page > Page size.
>> Once you’ve recreated your SVG, be sure to save it as an "Optimized SVG", and use the following options on the dialog that pops up.
>Options Tab:
-Tic Shorten color values
-Tic Convert CSS attributes to XML attributes
-Tic Group collapsing
-Tic Remove metadata
-Tic Remove comments
-Tic Work around render bugs
-Tic Remove the xml declaration
-Number of significant digits for cords: 5
-XML indentation (pretty-printing): None
>Ids Tab:
-Tic Remove unused ID names for elements
-Tic Shorten IDs
>> One last tip: avoid using strokes on your SVG images. Most of the rendering problems I encountered were solved by merging the strokes with the Fill area. Hope this helps.
ro...@gmail.com <ro...@gmail.com> #9
The vector import tool in android studio is horrible, it has mystery errors and does not say exactly what gives the error. Currently I'm getting a blank preview window with no errors. So I don't know what to do next to get my SVG file to get imported. I think in another year or two, you will finally be able to use SVG files in Android.
What the person above me said helped. I would like to confirm that you cannot use strokes. They just don't work. Also the opacity can't be set to anything other than 100%. And no text. If you have text you have to convert it to a path.
If you want to waste a day or two of your life, and wrestle with the AS import tool then be my guest.
What the person above me said helped. I would like to confirm that you cannot use strokes. They just don't work. Also the opacity can't be set to anything other than 100%. And no text. If you have text you have to convert it to a path.
If you want to waste a day or two of your life, and wrestle with the AS import tool then be my guest.
zt...@google.com <zt...@google.com> #10
The parsing exception on the width / height will be fixed pretty soon.
Now if you see anything not related to the size, feel free to either attach the broken SVG file or file another bug on that.
Thanks!
Now if you see anything not related to the size, feel free to either attach the broken SVG file or file another bug on that.
Thanks!
ma...@gmail.com <ma...@gmail.com> #12
For those who may be waiting for the patch, there's a simple solution: just change the size to pixels instead of whatever your file is using, e.g.
<svg width="561pt" height="561pt" viewBox="0 0 561 561" version="1.1" xmlns="http://www.w3.org/2000/svg ">
to
<svg width="561px" height="561px" viewBox="0 0 561 561" version="1.1" xmlns="http://www.w3.org/2000/svg ">
Seems that the embedded SVG interpreter only understands pixels haha.
<svg width="561pt" height="561pt" viewBox="0 0 561 561" version="1.1" xmlns="
to
<svg width="561px" height="561px" viewBox="0 0 561 561" version="1.1" xmlns="
Seems that the embedded SVG interpreter only understands pixels haha.
zt...@google.com <zt...@google.com> #13
@#13, right, or just remove the pt / px totally. B/c that didn't translate into dp automatically.
ro...@gmail.com <ro...@gmail.com> #15
> Now if you see anything not related to the size, feel free to either attach the broken SVG file or file another bug on that.
I do not see a preview or any errors from the attached SVG file.
I do not see a preview or any errors from the attached SVG file.
he...@lockaround.io <he...@lockaround.io> #16
[Comment deleted]
mm...@gmail.com <mm...@gmail.com> #17
In my case when creating a vector asset from attached SVG file I get exception:
Empty preview image!
EXCEPTION in parsing sample.svg:
empty StringException while parsing XML file:
Premature end of file.
I've noticed it's because of polyline and polygon shapes.
Empty preview image!
EXCEPTION in parsing sample.svg:
empty StringException while parsing XML file:
Premature end of file.
I've noticed it's because of polyline and polygon shapes.
mm...@gmail.com <mm...@gmail.com> #18
Replacing polylines and polygons with paths like that:
<polygon opacity="0.25" fill-rule="evenodd" clip-rule="evenodd" points="256.285,171.328 239.123,384.306 226.184,396.551
245.404,158.594 "/>
replace to:
<path opacity="0.25" fill-rule="evenodd" clip-rule="evenodd" d="M256.285,171.328 239.123,384.306 226.184,396.551
245.404,158.594z "/>
(notice the "z" at the end)
did the job.
<polygon opacity="0.25" fill-rule="evenodd" clip-rule="evenodd" points="256.285,171.328 239.123,384.306 226.184,396.551
245.404,158.594 "/>
replace to:
<path opacity="0.25" fill-rule="evenodd" clip-rule="evenodd" d="M256.285,171.328 239.123,384.306 226.184,396.551
245.404,158.594z "/>
(notice the "z" at the end)
did the job.
sa...@gmail.com <sa...@gmail.com> #19
Hello,
I have some <defs> tag error on SVG when use for android
I have some <defs> tag error on SVG when use for android
zt...@google.com <zt...@google.com> #20
Hi, Santosh,
Your issue is tracked, and will be addressed in 37092389
https://issuetracker.google.com/37092389
Your issue is tracked, and will be addressed in 37092389
aq...@gmail.com <aq...@gmail.com> #21
hey there still issue occurred with me
Description
Empty preview image!
EXCEPTION in parsing svg_logo2.svg:
For input string: "100%"Exception while parsing XML file:
Premature end of file.
To reproduce, right click the `res`folder in the Project view, then "New|VectorAsset". Select 'Local SVG file', then click the '...' button next to 'Image File:' and open the attached file. The error box appears containing 'Empty preview image!' and clicking on the "More...' link shows the above error.
I have hand-tweaked this file from the official SVG logo at