r

    Radoslaw Juszczyk

    1 year ago
    I am trying to display an image with jetpack compose… which is a normal PNG file inside drawable directory:
    …res/drawable-xxxhdpi/ic_test.png
    the code I use:
    Image(painter = painterResource(id = R.drawable.ic_test), contentDescription = "Test")
    produces this exception:
    java.lang.IllegalArgumentException: Only VectorDrawables and rasterized asset types are supported ex. PNG, JPG
    What am I doing wrong?
    Timo Drick

    Timo Drick

    1 year ago
    You call looks correct. Maybe do you have an other vector drawable with the same name?
    r

    Radoslaw Juszczyk

    1 year ago
    Thanks @Timo Drick, turned out the problem was with the image file ( I was looking for the issue in a wrong place) The file was saved with photoshop and weighed 8MB (I guess PS saved it with some extra data)…