I was trying to add a vector drawable to Android studio
Using the vector asset in Android studio, I've imported a psd file, it but it seems like there is a rendering problem as the preview and the result xml file are empty, please check the
output xml screenshot.
Asked
Active
Viewed 2,262 times
12
-
It supports a plain SVG format only. Post your SVG to check. – Denis Sologub Nov 01 '16 at 12:01
-
6Thanks, the SVG files is working fine. But do you have any idea why the psds not working since the vector asset says add "Local file (SVG, PSD)" – S qasem Nov 02 '16 at 08:45
-
2Same problem here PSDs are'nt working no pathData generated – Sjd Jan 30 '17 at 09:07
1 Answers
1
In your screenshot there is no pathdata in the file. Hence, nothing is drawn on screen. I am showing contents of a VectorDrawable xml file. Copy the contents into a blank xml file in android studio and see the shape drawn in blue on screen.
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="600dp"
android:height="600dp"
android:viewportWidth="800.0"
android:viewportHeight="800.0">
<path
android:pathData="M 162 8
q -07 00 -41 26
q -34 27 -50 64
q -25 59 -19 117
q 07 70 53 121
q 57 63 151 62
q 87 -01 140 -66
q 46 -55 48 -142
q 01 -56 -34 -105
q -38 -52 -77 -70
l -29 -11
q 16 -01 31 -02
q 59 -01 119 -02
"
android:strokeLineCap="round"
android:strokeColor="#f00f"
android:fillColor="#00000000"
android:strokeWidth="32"/>
</vector>

Vempati Satya Suryanarayana
- 317
- 4
- 4
-
-
Me too, I don't have pathData in my file, I think the file isn't correctly uploaded to android studio – Mohammed NAIMI Oct 03 '21 at 12:56