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
Can't start app only with Navigation <= No interface method startRestartGroup on ChildrenKt.Children(Children.kt:22) #122
Comments
This looks like a binary compatibility issue. What Compose version are you using? |
|
Aha! You are using a very old version of Decompose. Try updating to the latest one - 0.6.0. It should be compatible with Compose 1.1.0. |
You may encounter source incompatibility, feel free to ask if something doesn't compile and you are unsure how to migrate. |
Thanks, I switched to 0.6.0 just now. The migration is easy, just replacing There is no clue for this one:
Of course, you know, And why is By the way, I think the example repo should be updated and it's still using 0.2.3, which misled me. |
You have to use one of the functions defined here: either with initialStack: () -> List argument, or with initialConfiguration: C argument. So your code could be as follows (from the top of my head, there are possible mistakes): @Composable
inline fun <reified C : Parcelable> rememberRouter(
initialConfiguration: C,
handleBackButton: Boolean = false,
): Router<C, Any> {
val context = rememberComponentContext()
return remember {
context.router(
initialConfiguration = initialConfiguration,
handleBackButton = handleBackButton
) { configuration, _ ->
configuration
}
}
} or @Composable
inline fun <reified C : Parcelable> rememberRouter(
noinline initialStack: () -> List<C>,
handleBackButton: Boolean = false,
): Router<C, Any> {
val context = rememberComponentContext()
return remember {
context.router(
initialStack = initialStack,
handleBackButton = handleBackButton
) { configuration, _ ->
configuration
}
}
}
This is because the animations API (the
The approach described in the article is more like an example of what is possible in general. However this approach is discouraged by the Decompose library. Also some useful features (e.g. the nested navigation) are not covered by that article. The preferred way is described in another section of that tutorial, and is also being advised in the documentation. I will try to update the repo and the article, thanks for pointing that out! |
Thank for your help! I finished the migration and it does work. |
I followed this tutorial.
Of course, I checked this on medium.com
I almost only copied codes from the tutorial and changed the package name.
When starting desktop on InteliiJ IDEA:
When starting android on Android Studio.
The text was updated successfully, but these errors were encountered: