compose-destinations: NoSuchElementException: List contains no element matching the predicate.
Hi
I updated the Android Studio to “Android Studion Chipmunk - 2021.2.1 Patch1” and now I get a NoSuchElementException: List contains no element matching the predicate.
I am not sure that the problem is in the “navigation destination” package but it seems like that, because I commented all the other lines and only when I uncomment the line where it navigates to the next screen I ger the exception.
java.util.NoSuchElementException: List contains no element matching the predicate. at androidx.navigation.compose.NavHostKt$NavHost$4.invoke(NavHost.kt:181) 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(ComposableLambda.jvm.kt:34) at androidx.compose.animation.CrossfadeKt$Crossfade$4$1.invoke(Crossfade.kt:115) at androidx.compose.animation.CrossfadeKt$Crossfade$4$1.invoke(Crossfade.kt:110) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107) at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34) at androidx.compose.animation.CrossfadeKt.Crossfade(Crossfade.kt:124) at androidx.compose.animation.CrossfadeKt.Crossfade(Crossfade.kt:55) 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:2351) at androidx.compose.runtime.ComposerImpl.skipCurrentGroup(Composer.kt:2611) at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3198) at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3176) 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:3176) at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3141) at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:727) 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:970) at android.view.Choreographer.doCallbacks(Choreographer.java:796) at android.view.Choreographer.doFrame(Choreographer.java:727) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:957) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.app.ActivityThread.main(ActivityThread.java:7656) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@5545588, StandaloneCoroutine{Cancelling}@6280b21, AndroidUiDispatcher@ef6fb46]
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 20 (12 by maintainers)
Try updating it to 1.7.33-beta. This looks like some issue from official compose navigation which gets updated internally to the new stable version.
We inherit the good and also the bad with compose navigation I guess 😁
I’ll continue using above versions with 1.5.13-beta for now I guess 😄 thanx anyways
Can you try using same versions we have here?
https://github.com/raamcosta/compose-destinations/blob/main/buildSrc/src/main/java/Versions.kt
You should only need Kotlin, compose, compose compiler and compose destinations should be 1.6.13-beta (same you have now)
And you don’t need accompanist either. At least not accompanist navigation or accompanist material.