I have a png picture. I open it in Adobe Illustrator and save it as svg without changing default configuration:
This gives me this svg file:
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 18.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 100 100" enable-background="new 0 0 100 100" xml:space="preserve">
<image overflow="visible" width="714" height="714" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAsoAAALKCAYAAAArlndAAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJ
bWFnZVJlYWR5ccllPAAAA2ppVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdp
bj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6
...
ex8pzU1wT+bf4YnI2vz8uvwzq/PX6ueW58dHNvPztf4ZAGzZ/wswAPds0/tWAII4AAAAAElFTkSu
QmCC" transform="matrix(1 0 0 1 -307 -307)">
</image>
</svg>
When I try to import svg file in android studio I get this error:
Empty preview image!
Exception while parsing XML file:
Premature end of file.
Can anybody help me how to fix this? I import other svg files that have <path>
element and they work good.
SVG to VectorDrawable
plugin in Android Studio to importsvg
files. – Hive