compose-destinations: Accompanist `0.24.x` makes breaking animation API change.

Iโ€™m trying to upgrade to project to Kotlin 1.6.21. This necessitates that we bump compose to 1.2.0-beta01, and accompanist to 0.24.x. Accompanist makes the backwards incompatible change to remove NavGraphBuilder.navigate. Bumping both of those dependencies in my codebase causes the following runtime error, presumably because compose-destinations still depends on accompanist 0.23.x.

    java.lang.NoSuchMethodError: No static method navigation(Landroidx/navigation/NavGraphBuilder;Ljava/lang/String;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function1;)V in class Lcom/google/accompanist/navigation/animation/NavGraphBuilderKt; or its super classes (declaration of 'com.google.accompanist.navigation.animation.NavGraphBuilderKt' appears in /data/app/energy.octopus.octopusenergy.android.dev-p-WC31HpQkXr2Tkqenj6zg==/base.apk!classes20.dex)
        at com.ramcosta.composedestinations.animations.AnimatedNavHostEngine.navigation(AnimatedNavHostEngine.kt:102)
        at com.ramcosta.composedestinations.DestinationsNavHostKt.addNestedNavGraphs(DestinationsNavHost.kt:124)
        at com.ramcosta.composedestinations.DestinationsNavHostKt.addNavGraphDestinations(DestinationsNavHost.kt:106)
        at com.ramcosta.composedestinations.DestinationsNavHostKt.access$addNavGraphDestinations(DestinationsNavHost.kt:1)
        at com.ramcosta.composedestinations.DestinationsNavHostKt$DestinationsNavHost$2.invoke(DestinationsNavHost.kt:74)
        at com.ramcosta.composedestinations.DestinationsNavHostKt$DestinationsNavHost$2.invoke(DestinationsNavHost.kt:68)
        at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost(AnimatedNavHost.kt:252)
        at com.ramcosta.composedestinations.animations.AnimatedNavHostEngine.NavHost(AnimatedNavHostEngine.kt:83)
        at com.ramcosta.composedestinations.DestinationsNavHostKt.DestinationsNavHost(DestinationsNavHost.kt:68)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 18 (9 by maintainers)

Most upvoted comments

Multiple plans and havenโ€™t had time to even think about which to choose Ahah ๐Ÿ˜…

Ideally I would start releasing both stable and beta versions using corresponding versions of compose/accompanist. But yeah if compose 1.2 stable were to come soon, I could delay having to do that a bit more ๐Ÿ˜‹

That said, since I have multiple people interested in this, maybe start with multi release now ๐Ÿ™‚