Hi guys, I'm facing this issue in Compose Multipla...
# multiplatform
k
Hi guys, I'm facing this issue in Compose Multiplatform specifically in IOS in Android the same code is working fine, somewhere in my code a float is getting round off to int here are the logs, can anyone help here please
Copy code
Uncaught Kotlin exception: kotlin.IllegalArgumentException: Cannot round NaN value.
    at 0   OwnerApp.debug.dylib                0x10d1d6fdb        kfun:kotlin.Throwable#<init>(kotlin.String?){} + 99 
    at 1   OwnerApp.debug.dylib                0x10d1d0f3f        kfun:kotlin.Exception#<init>(kotlin.String?){} + 95 
    at 2   OwnerApp.debug.dylib                0x10d1d110f        kfun:kotlin.RuntimeException#<init>(kotlin.String?){} + 95 
    at 3   OwnerApp.debug.dylib                0x10d1d1403        kfun:kotlin.IllegalArgumentException#<init>(kotlin.String?){} + 95 
    at 4   OwnerApp.debug.dylib                0x10d1e22a3        kfun:kotlin.math#roundToInt__at__kotlin.Float(){}<http://kotlin.Int|kotlin.Int> + 175 
    at 5   OwnerApp.debug.dylib                0x10d8e87db        kfun:androidx.compose.ui.unit.Density#roundToPx__at__androidx.compose.ui.unit.Dp(){}<http://kotlin.Int|kotlin.Int> + 163 
    at 6   OwnerApp.debug.dylib                0x10ddb8e7f        kfun:androidx.compose.ui.layout.MeasureScope#roundToPx__at__androidx.compose.ui.unit.Dp(){}kotlin.Int-trampoline + 99 
    at 7   OwnerApp.debug.dylib                0x10ddfb24b        kfun:androidx.compose.foundation.layout.OffsetNode.measure$lambda$0#internal + 267 
    at 8   OwnerApp.debug.dylib                0x10ddfb397        kfun:androidx.compose.foundation.layout.OffsetNode.$measure$lambda$0$FUNCTION_REFERENCE$0.invoke#internal + 107 
    at 9   OwnerApp.debug.dylib                0x10ddfb4db
e
the most likely cause is that you have
Dp.Unspecified
in use somewhere (possibly accidentally)
in general Compose questions should be asked in #CJLTWPH7S
k
okay I'll move it there
but can you just give me a little detail, why Dp.unspecified breaks this
e
it cannot be converted to px
k
understood, Dp.Unspecified basically gives Dp(Float.NaN)
thanks a lot