2015-10-14 6 views
15

Ich habe getestet Andorid Studio mit dem neuen Gradle-Plugin - 1.4.0-Beta3.Android Studio Vektor Asset Import Fehler - Tags nicht unterstützt

Ich habe versucht, meine eigenen Vektor-Assets zu importieren, die in Inkscape erstellt wurden. Ich bekomme jedoch immer wieder Importfehler. Die Fehlermeldung enthält viele Tags in der SVG, die nicht unterstützt werden.

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

Weiß jemand die Ursache dafür? Ist es ein Fehler im Vektor-Asset-Tool? Oder vielleicht ein Problem mit SVGs erstellt von Inkscape? Oder werden kompliziertere svgs nicht unterstützt?

Danke!

+0

Das scheint wie ziemlich grundlegende Dinge nicht zu erlauben. Die meisten SVGs haben ein Element, und ein großer Teil der SVGs wird einen linearen Gradienten haben. –

+0

Ich hatte dieses Problem von CorelDraw zu Android Vektor Asset importieren. Dann finde ich die Lösung: versuchen Sie, Ihre SVG in Vektor mit diesem Tool konvertiert: https://shapeshifter.design/ Wenn es Ihr Problem –

Antwort

13

Die SVG-Importfunktion in Android Studio hat nur eingeschränkte Unterstützung für einige SVG-Funktionen.

Sie geben so viel in their announcement video. Sie sagen, sie beabsichtigen, den Importeur zu verbessern.

Beachten Sie jedoch, dass Verläufe in VectorDrawables sowieso nicht unterstützt werden.

+0

gelöst ist, was ist die Alternative als das Video sagt, kopieren Sie den Vektor-Code und appy bestimmte Änderungen um den Fehler zu beheben. – Killer

+1

Sie meinen, kopieren Sie die Pfaddefinition. Welches ist der Wert im Attribut 'd' des Elements ''. –

+0

VectorDrawables unterstützt keine Farbverläufe, aber Sie können ein GradientDrawable als ImageView-Hintergrund oder als Teil eines LayerDrawable verwenden, um denselben Effekt zu erzielen – Mark

Verwandte Themen