Status Update
Comments
il...@google.com <il...@google.com> #2
I don't think this is enough cause we don't know how it is being produced. If you could create a project that recreates this that would be great, if not please provide us with the steps and we can see if that helps.
ky...@gmail.com <ky...@gmail.com> #3
It looks like we were using a CopyOnWriteArrayList
in the Java version of NavController, which was resilient to removing an OnDestinationChangedListener
as part of the dispatch i.e.,
addOnDestinationChangedListener(object : OnDestinationChangedListener {
override fun onDestinationChanged(
controller: NavController,
destination: NavDestination,
arguments: Bundle?
) {
removeOnDestinationChangedListener(this)
}
})
// Note, you need to have at least one other OnDestinationChangedListener
// that is added after the one that is removed to duplicate this error
We lost that resiliency when we converted over to Kotlin, hence this error. We need to switch back.
ky...@gmail.com <ky...@gmail.com> #4
We get this crash as well. I have a simple sample project where it can't be reproduced so it could be due to our nested graphs.
Kinda tl;dr scenario where it happens Graph 1 > Graph 2 (Graph 2 has bottom hav) - Navigate to dynamic feature module and click back - Navigate with BottomNavigationView.
I've spent some time trying to get a sample project which recreates the crash without success as the request in #2. Is that still needed after
jb...@google.com <jb...@google.com>
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit cb7bd694963278c03e987603f51953f0b89d3f1c
Author: Jeremy Woods <jbwoods@google.com>
Date: Fri May 21 14:03:22 2021
Fix ConcurrentModificationException on the OnDestinationChangedListener
Go back to using the CopyOnWriteArrayList to ensure that
modifying the list of OnDestinationChangedListeners is safe.
RelNote: "You will no longer get a ConcurrentModificationException when
using OnDestinationChangedListeners."
Test: NavControllerTest
Bug: 188860458
Change-Id: Ib17074c773ed9462c6a69ad384c23e28fa8abaf6
M navigation/navigation-runtime/src/androidTest/java/androidx/navigation/NavControllerTest.kt
M navigation/navigation-runtime/src/main/java/androidx/navigation/NavController.kt
jb...@google.com <jb...@google.com> #6
This has been fixed internally and will be available in the Navigation 2.4.0-alpha02
release.
ky...@gmail.com <ky...@gmail.com> #7
Will that be tracked in a separate issue?
jb...@google.com <jb...@google.com> #8
You can follow
na...@google.com <na...@google.com> #9
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-compose:2.8.0-alpha04
Description
Component used: Navigation
Version used: 2.8.0-SNAPSHOT
Android versions reproduced on: U
Introduced inhttps://android-review.googlesource.com/c/platform/frameworks/support/+/2853474
When a regular back is performed,
inPredictiveBack
will be set to false immediately, causing theAnimatedContent
to recompose.Transition may not complete by the time but will jump to the final state.