JetBrains / compose-multiplatform

Compose Multiplatform, a modern UI framework for Kotlin that makes building performant and beautiful user interfaces easy and enjoyable.
https://jetbrains.com/lp/compose-multiplatform
Apache License 2.0
16.27k stars 1.18k forks source link

Navigation Compose Multiplatform `2.8.0-alpha01` - Exception when navigate with arguments #4633

Closed serbelga closed 7 months ago

serbelga commented 7 months ago

I was trying to use the new Navigation Compose Multiplatform implementation on my project https://github.com/serbelga/Todometer-KMP/pull/515 and there's a crash on iOS and Desktop platforms when navigate with arguments.

Desktop:

Caused by: java.lang.IllegalArgumentException: Navigation destination that matches route taskdetail/d3004435-4d3d-45bd-905b-67429eea7668 
cannot be found in the navigation graph ComposeNavGraph startDestination={Destination route=home}

Affected platforms

Versions

Screenshots

Here's a screenshot of debugger on composable function in NavHost

Captura de pantalla 2024-04-16 a las 20 13 20

I'm defining this route as taskdetail/{taskId} as AndroidX Navigation Compose documentation specifies.

PMARZV commented 7 months ago

Its been fixed in this pull request theoretically (merged today) https://github.com/JetBrains/compose-multiplatform-core/pull/1277

MatkovIvan commented 7 months ago

Yes, it's fixed by https://github.com/JetBrains/compose-multiplatform-core/pull/1277

It will be available in the next build

serbelga commented 7 months ago

Thanks!! 😉

okushnikov commented 2 months ago

Please check the following ticket on YouTrack for follow-ups to this issue. GitHub issues will be closed in the coming weeks.