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

Navigation Animation - Crash: List contains no element matching the predicate, while navigate fast between screen by bottom navigation #805

Closed
4 tasks done
razaghimahdi opened this issue May 13, 2022 · 5 comments
Assignees
Labels
bug Something isn't working triage me Issue that needs to be triaged

Comments

@razaghimahdi
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Is there a StackOverflow question about this issue?

  • I have searched StackOverflow

Is this an issue related to one of the samples?

  • Yes, this is a specific issue related to this samples repo.

Sample app

Other (bug not related to sample app)

What happened?

while navigate fast between screen by bottom navigation, app gets crash and the error is :
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.razzaghi.myshop, PID: 9103
java.util.NoSuchElementException: List contains no element matching the predicate.
at androidx.navigation.compose.NavHostKt$NavHost$4.invoke(NavHost.kt:180)
at androidx.navigation.compose.NavHostKt$NavHost$4.invoke(NavHost.kt:141)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$1.invoke(ComposableLambda.jvm.kt:127)
at androidx.compose.runtime.internal.ComposableLambdaImpl$invoke$1.invoke(ComposableLambda.jvm.kt:127)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:142)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2350)
at androidx.compose.runtime.ComposerImpl.skipToGroupEnd(Composer.kt:2633)
at androidx.compose.animation.CrossfadeKt.Crossfade(Crossfade.kt:56)
at androidx.navigation.compose.NavHostKt.NavHost(NavHost.kt:141)
at androidx.navigation.compose.NavHostKt$NavHost$5.invoke(Unknown Source:13)
at androidx.navigation.compose.NavHostKt$NavHost$5.invoke(Unknown Source:10)
at androidx.compose.runtime.RecomposeScopeImpl.compose(RecomposeScopeImpl.kt:142)
at androidx.compose.runtime.ComposerImpl.recomposeToGroupEnd(Composer.kt:2350)
at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2610)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3196)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3174)
at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:252)
at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source:1)
at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:3174)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3140)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:722)
at androidx.compose.runtime.Recomposer.performRecompose(Recomposer.kt:876)
at androidx.compose.runtime.Recomposer.access$performRecompose(Recomposer.kt:107)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:485)
at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$2.invoke(Recomposer.kt:454)
at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:34)
at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1056)
at android.view.Choreographer.doCallbacks(Choreographer.java:880)
at android.view.Choreographer.doFrame(Choreographer.java:809)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1043)
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:8057)
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.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@78bf9d2, androidx.compose.ui.platform.MotionDurationScaleImpl@7238aa3, StandaloneCoroutine{Cancelling}@b71e1a0, AndroidUiDispatcher@3fc0159]

Relevant logcat output

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@razaghimahdi razaghimahdi added bug Something isn't working triage me Issue that needs to be triaged labels May 13, 2022
@daflecardoso
Copy link

@razaghimahdi

Looks like a library version

with crash -> implementation 'androidx.navigation:navigation-compose:2.5.0-rc01'

without crash -> implementation "androidx.navigation:navigation-compose:2.4.2"

Try to downgrade and test again. It worked for me.

@Feinate
Copy link

Feinate commented May 16, 2022

Same for me ! Downgraded to 2.4.2 and it worked for me

@simona-anomis
Copy link
Contributor

Thanks for reporting! This is a known API bug indeed, you can follow the progress in this bug and when it will be resolved:
https://issuetracker.google.com/issues/234054916

@benjamin-luescher
Copy link

Works with 2.5.1

@razaghimahdi
Copy link
Author

@benjamin-luescher yeah actually 2.5.1 works for me, 2.4.2 still has crashing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage me Issue that needs to be triaged
Projects
None yet
Development

No branches or pull requests

5 participants