Closed Vaibhav2002 closed 6 months ago
On 1.0.0-rc08 this onEach
function does not exist anymore. Could you try to update it to see if this fixes?
If it does not fix, can you share the report on the new version?
I will investigate it. Can you also share your Navigator setup? Describe more how you are using Voyager.
The ScreenModelStore uses a ThreadSafeMap so kotlin.ConcurrentModificationException
should not be happening unless our ThreadSafeMap is not working properly
Can you try this PR? https://github.com/adrielcafe/voyager/pull/245
Just checkout to the branch and run ./gradlew -Pversion="1.0.0-SNAPSHOT" publishToMavenLocal
Sure, I'll check it
On 1.0.0-rc08 this
onEach
function does not exist anymore. Could you try to update it to see if this fixes? If it does not fix, can you share the report on the new version?I will investigate it. Can you also share your Navigator setup? Describe more how you are using Voyager.
The ScreenModelStore uses a ThreadSafeMap so
kotlin.ConcurrentModificationException
should not be happening unless our ThreadSafeMap is not working properly
It crashed on rc-08 as well This is my Navigator Setup
Navigator(startScreen) {
this.navigator = it
Scaffold(
modifier = modifier,
content = {
Box(modifier = Modifier.padding(it)) {
CurrentScreen()
}
},
topBar = {
if (it.lastItem.key in screensWithoutAppBar) return@Scaffold
if (it.lastItem.key == SearchScreen.key)
searchBarData?.let { data -> SearchBar(data) } ?: MedialAppBar(scrollBehavior)
else MedialAppBar(scrollBehavior)
},
)
}
Can you try this PR? #245
Just checkout to the branch and run
./gradlew -Pversion="1.0.0-SNAPSHOT" publishToMavenLocal
Running this task fails
> Task :buildSrc:compileKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':buildSrc:compileKotlin'.
> Error while evaluating property 'compilerOptions.jvmTarget' of task ':buildSrc:compileKotlin'.
> Failed to calculate the value of property 'jvmTarget'.
> Unknown Kotlin JVM target: 21
I've even tried changing my java version, gradle JDK version to 21, nothing works
I also have this problem when using the latest version of the library. How to solve it?
Fixed in 1.0.0-rc09
, can you folks validate?
Fixed in
1.0.0-rc09
, can you folks validate?
Unfortunately, this bug does not seem to be resolved
Uncaught Kotlin exception: kotlin.ConcurrentModificationException
at 0 Chat 0x10538b9af kfun:kotlin.Exception#<init>(kotlin.String?;kotlin.Throwable?){} + 143
at 1 Chat 0x10538bbcf kfun:kotlin.RuntimeException#<init>(kotlin.String?;kotlin.Throwable?){} + 143
at 2 Chat 0x10538cc77 kfun:kotlin.ConcurrentModificationException#<init>(kotlin.String?;kotlin.Throwable?){} + 143
at 3 Chat 0x10538cceb kfun:kotlin.ConcurrentModificationException#<init>(){} + 95
at 4 Chat 0x1053f1f97 kfun:kotlin.collections.HashMap.Itr#checkForComodification(){} + 243
at 5 Chat 0x1053f211f kfun:kotlin.collections.HashMap.KeysItr#next(){}1:0 + 203
at 6 Chat 0x1054997ff kfun:kotlin.collections.Iterator#next(){}1:0-trampoline + 99
at 7 Chat 0x105473a13 kfun:kotlin.sequences.FilteringSequence.object-1.calcNext#internal + 223
at 8 Chat 0x105473d5f kfun:kotlin.sequences.FilteringSequence.object-1.hasNext#internal + 123
at 9 Chat 0x10549972f kfun:kotlin.collections.Iterator#hasNext(){}kotlin.Boolean-trampoline + 91
at 10 Chat 0x1056f342f kfun:cafe.adriel.voyager.navigator.Navigator#dispose(cafe.adriel.voyager.core.screen.Screen){} + 703
at 11 Chat 0x1056fbda3 kfun:cafe.adriel.voyager.navigator.internal.object-2.dispose#internal + 1331
at 12 Chat 0x1056d7acb kfun:androidx.compose.runtime.DisposableEffectResult#dispose(){}-trampoline + 91
at 13 Chat 0x10560314f kfun:androidx.compose.runtime.DisposableEffectImpl.onForgotten#internal + 183
withContext(Dispatchers.Main.immediate) {
navigator.replaceAll(LoginSceen())
}
or
navigator.replaceAll(LoginSceen())
Will report an error
Now it is broken in another place :S It will be fixed soon.
@InternalVoyagerApi
public fun dispose(
screen: Screen
) {
ScreenLifecycleStore.remove(screen)
stateKeys
.toMutableSet() // Copy
.filter { it.startsWith(screen.key) }
.forEach { key ->
stateHolder.removeState(key)
stateKeys -= key
}
}
Thanks for the fix @DevSrSouza , looking forward to the release 🙂. I am still not sure why is this crash related to 1.9.20 kotlin update, if anyone can explain the solution that would be great for learning.
Ah, this would fix the crash that I'm seeing. Also looking forward to the next release since I'm on Kotlin 1.9.20. :)
I have reproduced here and fix it on #249 .
Fixed on 1.0.0-rc10
Crash on iOS When Navigating, after upgrade to Kotlin 1.9.20
After upgrading to Kotlin 1.9.20 App is crashing in iOS, when it navigates On Android, its working fine
Stack Trace: