I’m having a bit of issue to display my own app ic...
# compose
t
I’m having a bit of issue to display my own app icon. Right now I’m trying the following
Copy code
Icon(ImageBitmap.imageResource(R.mipmap.ic_launcher), contentDescription = null)
And I’m receiving:
Copy code
java.lang.ClassCastException: class android.graphics.drawable.AdaptiveIconDrawable cannot be cast to class android.graphics.drawable.BitmapDrawable
m
try
painterResource = (@DrawableRes id: Int)
t
Then I have :
Copy code
java.lang.IllegalArgumentException: Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG
This is my icon folder
m
Seems like the anydpi version is causing this.
t
Yeah, but it’s to support adaptive icons, it’s the files the AndroidStudio generate when creating the app icon
m
Try following this topic.
t
I think the “easy fix” is to make a copy of my .png with a different name and use it specifically for this case
Now the .png show as black when using both painterResource or imageResource 😕
m
any updates to solve this(?)