Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android Studio Vector Asset Import Error - Tags Not Supported

I've been testing out Andorid Studio with the new gradle plugin - 1.4.0-beta3.

I've been trying to import my own vector assets, made in Inkscape. However I keep getting import errors. The error message includes lots of tags in the svg that arn't supported.

In mm_card.svg:
ERROR@ line 54 <defs> is not supported
ERROR@ line 56 <linearGradient> is not supported
ERROR@ line 58 <stop> is not supported
ERROR@ line 62 <stop> is not supported
ERROR@ line 66 <stop> is not supported
ERROR@ line 70 <stop> is not supported
ERROR@ line 74 <stop> is not supported
ERROR@ line 78 <stop> is not supported
ERROR@ line 83 <linearGradient> is not supported
ERROR@ line 85 <stop> is not supported
ERROR@ line 89 <stop> is not supported
ERROR@ line 93 <stop> is not supported
ERROR@ line 97 <stop> is not supported
ERROR@ line 102 <linearGradient> is not supported
ERROR@ line 104 <stop> is not supported
ERROR@ line 108 <stop> is not supported
ERROR@ line 113 <linearGradient> is not supported
ERROR@ line 115 <stop> is not supported
ERROR@ line 119 <stop> is not supported
ERROR@ line 123 <stop> is not supported
ERROR@ line 127 <stop> is not supported
ERROR@ line 131 <stop> is not supported
ERROR@ line 135 <stop> is not supported
ERROR@ line 139 <stop> is not supported

Does anyone know the cause of this? Is it an error in the vector asset tool? Or perhaps a problem with svgs created by Inkscape? Or are more complicated svgs not supported?

Thanks!

like image 529
enyciaa Avatar asked Oct 14 '15 16:10

enyciaa


People also ask

Does Android studio support SVG?

Android Studio includes a tool called Vector Asset Studio that helps you add material icons and import Scalable Vector Graphic (SVG) and Adobe Photoshop Document (PSD) files into your project as vector drawable resources.

How do I edit SVG files on Android?

To edit an SVG image in Office for Android, tap to select the SVG you want to edit and the Graphics tab should appear on the ribbon. Styles - These are a set of predefined styles you can add to quickly change the look of your SVG file.


1 Answers

The SVG import feature in Android Studio has only limited support for some SVG features.

They state as much in their announcement video. They say they intend to improve the importer.

But also note that gradients are not supported in VectorDrawables anyway.

like image 67
Paul LeBeau Avatar answered Oct 20 '22 09:10

Paul LeBeau