2015-10-14 10 views
15

私は新しいgradleプラグイン - 1.4.0-beta3でAndorid Studioをテストしました。Androidスタジオのベクター資産インポートエラー - サポートされていないタグ

私はInkscapeで作成した独自のベクトルアセットをインポートしようとしています。しかし、私はインポートエラーを取得し続ける。エラーメッセージには、サポートされていないsvgのタグがたくさん含まれています。

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 

誰でも原因を知っていますか?ベクトル資産ツールのエラーですか?あるいは、Inkscapeによって作成されたsvgの問題でしょうか?または、より複雑なsvgsはサポートされていませんか?

ありがとうございます!

+0

これは非常に基本的なもののように思えます。ほとんどのSVGは要素を持ち、SVGの大部分は直線勾配を持ちます。 –

+0

私はCorelDrawからAndroidのベクトル資産のインポートにこの問題がありました。解決策を見つける:あなたのSVGをこのツールを使ってベクターに変換しようとする:https://shapeshifter.design/あなたの問題が解決された場合 –

答えて

13

Android StudioのSVGインポート機能では、一部のSVG機能のサポートが限られています。

their announcement videoには多くの状態があります。彼らは、輸入者を改善しようとしていると言います。

ただし、VectorDrawablesではグラデーションはサポートされていません。

+0

の代替案は何ですか?ビデオがベクターコードをコピーし、エラーを修正します。 – Killer

+1

パス定義をコピーすることを意味します。 ''要素の 'd'属性の値はどれですか。 –

+0

VectorDrawablesはグラデーションをサポートしていませんが、GradientDrawableをImageViewの背景として使用することも、LayerDrawableの一部として使用しても同じ効果を得ることができます – Mark

関連する問題