question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix crash when calculating scroll

See original GitHub issue

Idea Description

Fatal Exception: java.lang.IllegalStateException
Offset is unspecified
androidx.compose.ui.geometry.Offset.getX-impl (Offset.java:28)
io.github.droidkaigi.confsched2022.feature.sessions.ScreenScrollState$scroll$2$1.invokeSuspend (ScreenScrollState.java:31)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (BaseContinuationImpl.java:8)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.java:100)
image
    suspend fun scroll(
        dragAmount: Offset,
        timeMillis: Long,
        position: Offset,
    ) {
        val nextPossibleX = calculatePossibleScrollX(dragAmount.x)
        val nextPossibleY = calculatePossibleScrollY(dragAmount.y)
        scrollState.scroll(
            Offset(nextPossibleX, nextPossibleY), // ←
value class Offset internal constructor(internal val packedValue: Long) {

    @Stable
    val x: Float
        get() {
            // Explicitly compare against packed values to avoid auto-boxing of Size.Unspecified
            check(this.packedValue != Unspecified.packedValue) {
                "Offset is unspecified" // ←
            }
            return unpackFloat1(packedValue)
        }

Reference images and links

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
takahiromcommented, Oct 7, 2022
image
1reaction
takahiromcommented, Sep 30, 2022

@Tomoyuki-TAKEZAKI I’m looking forward to seeing your PR! Assigned 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

List of a lot of items crash when scrolling in SwiftUI, How can I ...
The problem is the geometry reader. The GeometryReader shouldn't be inside a ScrollView because it will cause a memory leak. So, whenever we ......
Read more >
Finder crashing when scrolling through folders - CNET
Finder crashing when scrolling through folders ... Unfortunately there is no apparent fix for this issue, but people have at least found ...
Read more >
Understanding Source of Crashes - Power Platform Community
Aside from a persistent issue where scrolling through a large gallery very quickly will cause a crash, there doesn't seem to be any...
Read more >
UIStackView not laying out as expected in a UIScrollView
I'm attempting to put a (vertical) UIStackView in a UIScrollView, but it doesn't seem to want to scroll. Instead it it squishing all...
Read more >
[Skyrim] Tutorial: Fixing Crash to Desktop & Improving ...
[Main Theme] Elder Scrolls Adventures: Redguard Bethesda Softworks Multiple Themes Elder Scrolls 3: Morrowind/Tribunal/Bloodmoon Bethesda ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found