Reputation: 609
After convert my image from png to svg, I am trying to use vector asset to generate a svg file. But androidstudio always shows "Could not generate a preview" and I cant go forward. Like this: Android Studio Vector asset always could not generate a preview
I tested almost all online converters, but none of them seems to work in android. I heard that I can fix the svg file editing it, but I dont know where is the problem!
<?xml version="1.0"?>
<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" width="138px" height="12px" viewBox="0 0 138 12" enable-background="new 0 0 138 12" xml:space="preserve"> <image id="image0" width="138" height="12" x="0" y="0"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIoAAAAMCAMAAACKsNWTAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAANlBMVEUAAAAAn8cAoMcAoMYA
ocfV1dXU1NTU1NTU1NQAn8/f398An8fV1dUAn8fV1dUAoMfV1dX///8mTk1DAAAAD3RSTlMAYL/v
X2C/718QEMDA8PAe3L+6AAAAAWJLR0QR4rU9ugAAAAd0SU1FB+MHAgYaM09dMGgAAACMSURBVDjL
zZRRC8UgCIXVbnWbVv7/XzuIWHuaMRD2PX8HjhYCACCFQD/YIKac09/NLNQHVKzQkXSQDieT+4Ss
mOgk+ZjYL9DYpF5EF5NXFd4cQFVczLqqhOdYW7HsYt6q1O1YczE/9EAf+rZrLcZSbiOIk1lmF7ZP
3MyJfbjemsi1MlqhsU9pTaKTeQKCCxqVvmXBxwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxOS0wNy0w
MlQwNjoyNjo1MSswMzowMBA5D0IAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTktMDctMDJUMDY6MjY6
NTErMDM6MDBhZLf+AAAAAElFTkSuQmCC" />
</svg>
Upvotes: 4
Views: 701
Reputation: 101868
VectorDrawables are intended for icons with vector paths in them. Your SVG is not one of those. All it contains is a PNG bitmap image of four circles. It is not taking any advantage of the power that SVGs (and VectorDrawables) offer.
VectorDrawables do not support bitmap images. If you want to make an SVG that will convert, you will need to use some sort of vector editor and redraw your SVG so that it consists of four vector circles.
Upvotes: 1