https://kotlinlang.org logo
#compose
Title
# compose
n

Nikolas Alvelo

08/15/2022, 2:48 PM
Hey folks, We're seeing a sporadic amount of IllegalArgumentExceptions related to
Constraints::bitsNeedForSize
in production. It seems to be inconsistently occurring across Android 12 devices, a lot of Samsung and others. The page in question uses an Accompanist
FlowRow
and the child elements are either
Row { ... }
or
Card { ... }
. We never saw this issue in testing over several months, so it seems to be device-specific. Has anyone else run into this scenario and were you able to resolve it? We are using Compose compiler 1.3.0, Compose 1.2.1, Accompanist 0.25.1, Kotlin 1.7.10, compile/target 32 Stacktrace:
Copy code
Fatal Exception: java.lang.IllegalArgumentException: Can't represent a size of 508326 in Constraints
       at androidx.compose.ui.unit.Constraints$Companion.bitsNeedForSize(Constraints.kt:403)
       at androidx.compose.ui.unit.Constraints$Companion.createConstraints-Zbe2FdA$ui_unit_release(Constraints.kt:363)
       at androidx.compose.ui.unit.ConstraintsKt.Constraints(Constraints.kt:433)
       at androidx.compose.foundation.layout.SizeModifier.getTargetConstraints-OenEA2s(Size.kt:737)
       at androidx.compose.foundation.layout.SizeModifier.measure-3p2s80s(Size.kt:749)
       at androidx.compose.ui.node.ModifiedLayoutNode.measure-BRTryo0(ModifiedLayoutNode.kt:53)
Full stacktrace
j

jossiwolf

08/15/2022, 4:09 PM
@Uchenna Okoye
u

uchennafokoye

08/15/2022, 7:50 PM
Thanks for the tag, @jossiwolf. I'll add this to our bug list
n

Nikolas Alvelo

08/15/2022, 8:28 PM
Is there any suggestion on mitigation as of now? I'm not really even sure how to begin debugging this, especially because we cannot reproduce it on any of our test devices.
32 Views