This single colorSpace crash has destroyed my app....
# compose
a
This single colorSpace crash has destroyed my app. 10k crash events in the last 7days. If anyone is able to figure out the cause or give any hint, it would be very helpful Crash in 🧵
Full log, I don't even know the cause of it.
t
Update your compose version, you are probably animating some colors with Color.Undefined.
a
Hi @Tolriq There are no colour animations, done by us. There is this function though, which I found in one of the traces
Copy code
fun Modifier.innerShadow(
    color: Color = Color.Black,
    cornersRadius: Dp = 0.dp,
    spread: Dp = 0.dp,
    blur: Dp = 0.dp,
    offsetY: Dp = 0.dp,
    offsetX: Dp = 0.dp
) = drawWithContent {

    drawContent()

    val rect = Rect(Offset.Zero, size)
    val paint = Paint()

    drawIntoCanvas {

        paint.color = color
        paint.isAntiAlias = true
        it.saveLayer(rect, paint)
        it.drawRoundRect(
            left = rect.left,
            top = <http://rect.top|rect.top>,
            right = rect.right,
            bottom = rect.bottom,
            cornersRadius.toPx(),
            cornersRadius.toPx(),
            paint
        )
        val frameworkPaint = paint.asFrameworkPaint()
        frameworkPaint.xfermode = PorterDuffXfermode(PorterDuff.Mode.DST_OUT)
        if (blur.toPx() > 0) {
            frameworkPaint.maskFilter = BlurMaskFilter(blur.toPx(), BlurMaskFilter.Blur.NORMAL)
        }
        val left = if (offsetX > 0.dp) {
            rect.left + offsetX.toPx()
        } else {
            rect.left
        }
        val top = if (offsetY > 0.dp) {
            <http://rect.top|rect.top> + offsetY.toPx()
        } else {
            <http://rect.top|rect.top>
        }
        val right = if (offsetX < 0.dp) {
            rect.right + offsetX.toPx()
        } else {
            rect.right
        }
        val bottom = if (offsetY < 0.dp) {
            rect.bottom + offsetY.toPx()
        } else {
            rect.bottom
        }
        paint.color = Color.Black
        it.drawRoundRect(
            left = left + spread.toPx() / 2,
            top = top + spread.toPx() / 2,
            right = right - spread.toPx() / 2,
            bottom = bottom - spread.toPx() / 2,
            cornersRadius.toPx(),
            cornersRadius.toPx(),
            paint
        )
        frameworkPaint.xfermode = null
        frameworkPaint.maskFilter = null
    }
}
Trace for inner shadow
t
As I said what Compose version ?
a
1.8.0-beta03
build threw the same error.
I had tried updating it till there
t
Then I have no idea, usually I would have ping Romain Guy but he abandoned us 😛 So just open an issue on the tracker hoping it"s triaged.
a
Thanks, I came from your thread. I have made the issue already, no action on it though -https://issuetracker.google.com/issues/403691993
t
Yes triage is barely done those days 😞 https://issuetracker.google.com/issues/398425789
s
there is available compose 1.8.0-rc01, have you tried it?
or the cutting-edge compose bom alpha androidx.composecompose bom alpha2025.03.00
a
It has been fixed for a few. But, some users are still reporting it.