There are several converters for converting vector drawables to svg (I know 3 of them, including ShapeShifter), but no one supports gradients.
This tool tries to support almost everything.
node <path-to-avd-to-svg>/index.js <source-vector-drawable.xml> <output.svg>-
<vector>→<svg>name→idviewportWidth,viewportHeight→width,height,viewBoxalpha→opacitytint,tintMode→ not supported, ignored
-
<group>→<g>name→idtranslateX,translateY,pivotX,pivotY,rotation,scaleX,scaleY→transform
-
<path>→<path>name→idpathData→dfillColor→fill,fill-opacityfillType→fill-rulestrokeColor→stroke,stroke-opacitystrokeWidth→stroke-widthstrokeLineCap→stoke-linecapstrokeLineJoin→stoke-linejoinstrokeMiterLimit→stoke-miterlimittrimPathStart,trimPathEnd,trimPathOffset→stroke-dasharray,stroke-dashoffset
-
<clip-path>→<clipPath>+<path>name→idpathData→din<path>
-
<aapt:attr>+<gradient>- supported in<path>forfillColorandstrokeColortype→ maps to<linearGradient>or<radialGradient>startColor→<stop offset="0%" stop-color="..." stop-opacity="...">centerColor→<stop offset="50%" stop-color="..." stop-opacity="...">endColor→<stop offset="100%" stop-color="..." stop-opacity="...">tileMode→ not supported, ignored
-
<item>inside<gradient>→<stop>offset→offsetcolor→stop-color,stop-opacity
-
<gradient android:type="linear">→linearGradientstartX→x1startY→y1endX→x2endY→y2
-
<gradient android:type="radial">→radialGradientcenterX→cxcenterY→cygradientRadius→fr
-
<gradient android:type="sweep">→ no direct mapping in svg, converted to radialGradient
- Resource references (eg.
@color/some_color)