-
Notifications
You must be signed in to change notification settings - Fork 606
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 Material] Crash after updating to Accompanist 0.24.8-beta (+ Compose 1.2.0-beta01) and later versions #1162
Comments
Update 1 Update 2 |
I had a similar crash, reverting accomponist back to 0.24.7-alpha worked for me |
I experienced the same crash. Also reverting accompanist back to 0.24.6-alpha fixed the issue for me. |
I had similiar crash, but with normal navigation (NavHost) |
The problem is related To normal Navigation Library -> android/compose-samples#805 |
I actually already used "androidx.navigation:navigation-compose:2.4.1" before/after upgrading so it seems unrelated to the issue that I reported. But I will look into updating this as well - this dependency fell off my radar |
Yes, bc Accompanist is based on Normal Navigation LIbrary so.. if there is a problem in The normal version, there'll be in Accompanist too. |
Still an issue with: accompanist = "0.24.9-beta" |
We have the same issue with: accompanist = "0.24.10-beta" For us, it's caused when a custom argument is used:
if I comment out the argument parameter, it works but of course I can't get that data. We don't have this issue with: |
Hello, the same thing happened to me, and I have "fixed" it by downgrading accompanist to 0.24.7-alpha. Thank you! |
This seems to be related to an issue in the base Navigation library. This issues has been fixed in the upcoming Navigation Edit: That fix was actually in NavHost directly and won't fix this. Will need something AnimatedNavHost for this. |
These issues actually might just have the same error, but be different issues. Does anyone have a sample project that reproduces this? |
I can confirm that this other fix does not solve this problem.
I can reproduce it but the proprietary app I'm working on is quite big so it could be a big effort to try to extract a minimum reproducer. Maybe I would find the time for it, but I can't make any promises. I tried with:
|
Still same issue here: Compose 1.2.0-beta03 Full stacktrace:
|
Why was this issue closed? I tried with Compose 1.2.0-beta03 And the issue above is still present. |
I can report the same result as @luiscurini . It's still an issue when these dependencies are used. Stacktrace:
Please reopen @bentrengrove |
It could be that this has the same root cause as #1175 In that case there is a sample project to reproduce the issue: #1175 (comment) |
Also have this issue with version Tried with nav_version |
I'm having Navigation compose = "1.2.0-rc01"
navigation = "2.5.0-rc02"
accompanist = "0.24.9-beta" Stacktrace: E/AndroidRuntime: FATAL EXCEPTION: main
java.util.NoSuchElementException: List contains no element matching the predicate.
at com.google.accompanist.navigation.animation.AnimatedNavHostKt$AnimatedNavHost$9.invoke(AnimatedNavHost.kt:249)
at com.google.accompanist.navigation.animation.AnimatedNavHostKt$AnimatedNavHost$9.invoke(AnimatedNavHost.kt:201)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:135)
at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
at androidx.compose.animation.AnimatedContentKt$AnimatedContent$5$1$4.invoke(AnimatedContent.kt:658)
at androidx.compose.animation.AnimatedContentKt$AnimatedContent$5$1$4.invoke(AnimatedContent.kt:648)
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.AnimatedVisibilityKt.AnimatedEnterExitImpl(AnimatedVisibility.kt:939)
at androidx.compose.animation.AnimatedVisibilityKt.AnimatedVisibility(AnimatedVisibility.kt:607)
at androidx.compose.animation.AnimatedContentKt$AnimatedContent$5$1.invoke(AnimatedContent.kt:638)
at androidx.compose.animation.AnimatedContentKt$AnimatedContent$5$1.invoke(AnimatedContent.kt:625)
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.AnimatedContentKt.AnimatedContent(AnimatedContent.kt:671)
at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost(AnimatedNavHost.kt:196)
at com.google.accompanist.navigation.animation.AnimatedNavHostKt$AnimatedNavHost$11.invoke(Unknown Source:23)
at com.google.accompanist.navigation.animation.AnimatedNavHostKt$AnimatedNavHost$11.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:2618)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3205)
at androidx.compose.runtime.ComposerImpl$doCompose$2$5.invoke(Composer.kt:3183)
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:3183)
at androidx.compose.runtime.ComposerImpl.recompose$runtime_release(Composer.kt:3148)
at androidx.compose.runtime.CompositionImpl.recompose(Composition.kt:739)
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)
E/AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:236)
at android.app.ActivityThread.main(ActivityThread.java:7889)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:600)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967)
Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@e75298d, androidx.compose.ui.platform.MotionDurationScaleImpl@a99d742, StandaloneCoroutine{Cancelling}@222f353, AndroidUiDispatcher@4371490] |
Still an issue on:
|
Got the same crash on the latest versions |
Still an issue with |
I have added https://issuetracker.google.com/issues/238336704 that didn't include the animate nav host because they have closed the previous issue and nobody is answering the comments. |
The issue in #1175 is unrelated to this so we are still looking for a sample for reproducing this issue. |
@jbw0033 I have created a sample project: https://github.com/polivmi1/sample1162 |
Since moving to using visibleEntries, if you change your start destination dynamically, instead of dropping the graph and rebuilding, the AnimatedNavHost crashes. The reason for this crash is that setting the graph synchronously pops the entire back stack, which clears all of the visibleEntries so there is a frame in AnimatedNavHost where it fails to find any of the old entries. We should move setNavGraph over to using the popWithTransition function, but there is pre-req works that needs to be done. So as a stop gap, we will return null from visibleEntries and disable the animations on AnimatedNavHost. Fixes google#1162
I cannot reproduce this issue on a Samsung Galaxy S21 (Android 12) after bumping my dependencies:
However, I could still reproduce the error on a Google Pixel 6 (Android 13 beta) + prelaunch report from Google Play on various devices (Google Pixel models + Samsung Galaxy S20 / Android 10):
|
After more library updates I can no longer reproduce this issue at all. Relevant (somewhat) library updates I did to fix the problem completely:
Probably fixed in #1243 |
Description
Cannot start application. It crashes immediately. Stacktrace:
Steps to reproduce
Start the app
Expected behavior
App starts
Additional context
accompanist = "0.24.8-beta"
androidx-activity-compose = "1.5.0-rc01" // Also tried with 1.4.1 with same results
androidx-compose = "1.2.0-beta01"
The text was updated successfully, but these errors were encountered: