telephoto: IllegalStateException: maximumVelocity should be a positive value
We are seeing a pretty substantial amount of errors in the latest version (0.9.0) that leads to this method:
And all the stacktraces look like this (with value 0.0):
Fatal Exception: java.lang.IllegalStateException
maximumVelocity should be a positive value. You specified=0.0
androidx.compose.ui.input.pointer.util.VelocityTracker1D.calculateVelocity (VelocityTracker.kt:283)
androidx.compose.ui.input.pointer.util.VelocityTracker.calculateVelocity-AH228Gc (VelocityTracker.kt:102)
me.saket.telephoto.zoomable.internal.TransformableNode$pointerInputNode$1$1$2.invokeSuspend (transformable.kt:152)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTaskKt.resume (DispatchedTask.kt:175)
kotlinx.coroutines.DispatchedTaskKt.dispatch (DispatchedTask.kt:164)
or this (with a tiny value, that looks like a 0 approximation in float):
Fatal Exception: java.lang.IllegalStateException
maximumVelocity should be a positive value. You specified=-1.3029473E-34
androidx.compose.ui.input.pointer.util.VelocityTracker1D.calculateVelocity (VelocityTracker.kt:283)
androidx.compose.ui.input.pointer.util.VelocityTracker.calculateVelocity-AH228Gc (VelocityTracker.kt:102)
me.saket.telephoto.zoomable.internal.TransformableNode$pointerInputNode$1$1$2.invokeSuspend (transformable.kt:152)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTaskKt.resume (DispatchedTask.kt:175)
kotlinx.coroutines.DispatchedTaskKt.dispatch (DispatchedTask.kt:164)
I’m not sure why it would throw here to be honest, since we always provide sane values Velocity(Int.MAX_VALUE.toFloat(), Int.MAX_VALUE.toFloat()). Could this be an issue with the devices packing floats incorrectly?
The device repartition is as follow:
- 70% Huawei
- 20% Samsung
- 6% Xiaomi
- 1% Hisense
- 3% Other (6)
About this issue
- Original URL
- State: open
- Created 3 months ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- Update telephoto to v0.10.0 (#1379) [](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age ... — committed to ZacSweers/CatchUp by renovate[bot] 3 months ago
- Update dependency me.saket.telephoto:zoomable-image-coil to v0.10.0 (#1339) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [me.saket.telephoto:zooma... — committed to slackhq/circuit by slack-oss-bot 3 months ago
@SimonMarquis will you be able to share your apk here? https://issuetracker.google.com/issues/338381315#comment2
Oof. Considering that
Velocity(Int.MAX_VALUE.toFloat(), Int.MAX_VALUE.toFloat())was also causing the same crash, I don’t think the values provided byViewConfigurationare invalid…I’ll file a bug report.
Our app update will be rolled-out starting next monday 🚀
I just released https://github.com/saket/telephoto/releases/tag/0.10.0. Can you please give it a try?