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

Mark

02/24/2024, 4:03 AM
After recently migrating my main app screen to compose (scaffold, navdrawer, snackbar etc). I received this crash this morning in crashlytics:
Copy code
Exception java.lang.IllegalArgumentException: The initial value must have an associated anchor.
  at androidx.compose.material.SwipeableKt$swipeable$3.invoke (Swipeable.kt)
The rest of the stacktrace goes on for a few miles, but nothing tangible that can lead me to which part of my code is triggering it. A quick search shows that this is a
BottomSheet
issue, but I’m not using such a thing. The only possible thing it could be is
SnackbarHost
but my content is always a
Text
composable with padding and text (i.e. cannot have zero size). However, I do use
SwipeToDismiss
around it to support that functionality. Any ideas?
Generally speaking, It’s becoming more and more common to get crashes in compose where there is not enough information in the stacktrace or error message to figure out where in the application code the problem is triggered from. Are there any good tactics (for example crashlytics keys) in order to get around this?
2 Views