Does Compose Beta09 have a bug loading vector reso...
# compose
m
Does Compose Beta09 have a bug loading vector resources with
painterResource(R.drawable.vector)
? I cannot load any vector asset from resources to show in Image.
Here's my Image: Image(painter = painterResource(id = R.drawable.home), contentDescription = "Android Icon", modifier = Modifier .clip(RoundedCornerShape(10)) .width(300.dp) .height(200.dp) , contentScale = ContentScale.Crop) Text("Vector", fontSize = 10.sp) Spacer(Modifier.height(10.dp)) And home.xml: <vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="150dp" android:height="150dp" android:viewportWidth="150" android:viewportHeight="150" android:tint="?attr/colorControlNormal"> <path android:fillColor="@android:color/white" android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z"/> </vector>
c
I don’t think there are any known bugs. I just tested a project with beta09 that has vector drawables
m
Which version of Kotlin are you using? Mine is 1.5.10 in Android Studio.
c
In copy-pasting your code here, it seems the issue is with the
contentScale
parameter. When I remove it, the vector shows up as expected
1
I’m using 1.5.10 also
And using Arctic Fox Beta 4
@Nader Jawad may be able to provide more insight as well
m
I'm not sure if the issue is caused by contentScale. For example, this vector (when imported in Android Studio) is loaded (even with contentScale), while this one is not.
n
If you could file a bug and attach the vector assets that would be great. I'm OOO right now but can take a look when I return