Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when refreshContentTransformation is called #36

Closed
pawelcala opened this issue Jul 26, 2023 · 8 comments
Closed

Crash when refreshContentTransformation is called #36

pawelcala opened this issue Jul 26, 2023 · 8 comments

Comments

@pawelcala
Copy link

pawelcala commented Jul 26, 2023

Using ZoomableAsyncImages inside HorizontalPager. If I use animateScrollToPage on PagerState to second next page (suppose not loaded yet) i get crash:

java.lang.IllegalStateException: Check failed.
	at me.saket.telephoto.zoomable.ZoomableState.refreshContentTransformation$zoomable_release(ZoomableState.kt:367)
	at me.saket.telephoto.zoomable.ZoomableStateKt$rememberZoomableState$1$1.invokeSuspend(ZoomableState.kt:82)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
	at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
	at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
	at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
	at android.os.Handler.handleCallback(Handler.java:938)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7839)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@c0693d9, androidx.compose.runtime.BroadcastFrameClock@2af419e, StandaloneCoroutine{Cancelling}@8d1447f, AndroidUiDispatcher@d330c4c]

Occurs every time.

@saket
Copy link
Owner

saket commented Jul 26, 2023

I've been trying to investigate this for many weeks but it has proved difficult to reproduce! If you're able to consistently run into this, could you please share a reproducer project or a fork branch?

@pawelcala
Copy link
Author

https://gist.github.com/pawelcala/68fa20a41e37c1868a81f16bfea81856

if you go few times between first and last item the crash will eventually occur.

@MV-GH
Copy link

MV-GH commented Jul 31, 2023

Also had this happen but not in a horizontalpager. Just inside a box with .fillMaxSize(), (v1.0.0-alpha02)

I cant' reliable reproduce it, but I had this happen by opening a image (which opens a imageviewer and creates a ZoomableAsyncImage) And quickly double tapping on the image. Basically as soon as I see the image come in view.

stacktrace but its the same as above FATAL EXCEPTION: main Process: com.jerboa.debug, PID: 8556 java.lang.IllegalStateException: Check failed. at me.saket.telephoto.zoomable.ZoomableState.refreshContentTransformation$zoomable_release(ZoomableState.kt:355) at me.saket.telephoto.zoomable.ZoomableStateKt$rememberZoomableState$1$1.invokeSuspend(ZoomableState.kt:72) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81) at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:8061) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@9f866f1, androidx.compose.runtime.BroadcastFrameClock@d8772d6, StandaloneCoroutine{Cancelling}@f2d4957, AndroidUiDispatcher@2eaec44] getRecentTasks: taskId=12048 userId=0 baseIntent=Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.jerboa.debug/com.jerboa.MainActivity }

@saket
Copy link
Owner

saket commented Aug 1, 2023

Whoops I misread the original stacktrace and confused it with a different bug. This one is already fixed on trunk. Would either of you two mind using 0.5.0-SNAPSHOT until I'm able to make a stable release?

@MV-GH
Copy link

MV-GH commented Aug 1, 2023

How can I use 5.0.0-SNAPSHOT ? I used v1.0.0-alpha02 because that was the latest I could find. I have included the snapshots url https://oss.sonatype.org/content/repositories/snapshots/ in my repositories.

image

@saket
Copy link
Owner

saket commented Aug 1, 2023

Snapshot versions are hosted on a separate maven repository which will need to be added to your buildscript:

repositories {
  google()
  mavenCentral()
  maven {
    url 'https://oss.sonatype.org/content/repositories/snapshots/'
  }
}

1.0.0-alpha02 is actually older than 0.1.0. I was originally planning to use 1.0.0 as telephoto's first version but I realized I should iron out any bugs first. Sorry for the confusion!

@MV-GH
Copy link

MV-GH commented Aug 1, 2023

nvm, had settings.gradle overriding everything

@saket
Copy link
Owner

saket commented Aug 2, 2023

Lol yea sorry I meant 0.5.0 and not 5.0.0. I'm going ahead and closing this issue. Please re-open if you continue to see it?

@saket saket closed this as completed Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants