使用 compose 1.2.0-alpha02 和 AnimatedNavHost 时打开的应用程序崩溃

Crash of app on open app when using compose 1.2.0-alpha02 and AnimatedNavHost

当我使用带有新 alpha 版 compose 的伴奏者的 AnimatednavHost 导航的动画时,我的应用程序在启动时崩溃。

撰写版本:.2.0-alpha02

伴奏版本:0.20.3

崩溃:

E/AndroidRuntime: FATAL EXCEPTION: main
Process: ir.x.x, PID: 5715
java.lang.NoSuchMethodError: No static method AnimatedContent(Landroidx/compose/animation/core/Transition;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Alignment;Lkotlin/jvm/functions/Function4;Landroidx/compose/runtime/Composer;II)V in class Landroidx/compose/animation/AnimatedContentKt; or its super classes (declaration of 'androidx.compose.animation.AnimatedContentKt' appears in /x.apk)
    at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost(AnimatedNavHost.kt:242)
    at com.google.accompanist.navigation.animation.AnimatedNavHostKt.AnimatedNavHost(AnimatedNavHost.kt:91)
    at ir.x.x.activities.MainActivityKt$ScreenContainer.invoke(MainActivity.kt:200)
    at ir.x.x.activities.MainActivityKt$ScreenContainer.invoke(MainActivity.kt:199)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    at androidx.compose.material.ModalBottomSheetKt$ModalBottomSheetLayout.invoke(ModalBottomSheet.kt:330)
    at androidx.compose.material.ModalBottomSheetKt$ModalBottomSheetLayout.invoke(ModalBottomSheet.kt:326)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:116)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    at androidx.compose.foundation.layout.BoxWithConstraintsKt$BoxWithConstraints$measurables.invoke(BoxWithConstraints.kt:66)
    at androidx.compose.foundation.layout.BoxWithConstraintsKt$BoxWithConstraints$measurables.invoke(BoxWithConstraints.kt:66)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose.invoke(SubcomposeLayout.kt:310)
    at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose.invoke(SubcomposeLayout.kt:310)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:107)
    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:34)
    at androidx.compose.runtime.ActualJvm_jvmKt.invokeComposable(ActualJvm.jvm.kt:70)
    at androidx.compose.runtime.ComposerImpl$doCompose.invoke(Composer.kt:2591)
    at androidx.compose.runtime.ComposerImpl$doCompose.invoke(Composer.kt:2580)
    at androidx.compose.runtime.SnapshotStateKt__DerivedStateKt.observeDerivedStateRecalculations(DerivedState.kt:247)
    at androidx.compose.runtime.SnapshotStateKt.observeDerivedStateRecalculations(Unknown Source)
    at androidx.compose.runtime.ComposerImpl.doCompose(Composer.kt:2580)
    at androidx.compose.runtime.ComposerImpl.composeContent$runtime_release(Composer.kt:2531)
    at androidx.compose.runtime.CompositionImpl.composeContent(Composition.kt:482)
    at androidx.compose.runtime.Recomposer.composeInitial$runtime_release(Recomposer.kt:757)
    at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:2996)
    at androidx.compose.runtime.ComposerImpl$CompositionContextImpl.composeInitial$runtime_release(Composer.kt:2996)
    at androidx.compose.runtime.CompositionImpl.setContent(Composition.kt:433)
    at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.subcomposeInto(SubcomposeLayout.kt:328)
    at androidx.compose.ui.layout.LayoutNodeSubcompositionsState.access$subcomposeInto(SubcomposeLayout.kt:226)
    at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose.invoke(SubcomposeLayout.kt:303)
    at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$subcompose.invoke(SubcomposeLayout.kt:300)
    at androidx.compose.runtime.snapshots.SnapshotStateObserver.withNoObservations(SnapshotStateObserver.kt:142)
    at androidx.compose.ui.node.OwnerSnapshotObserver

更新伴奏版本到新的稳定版本,它会工作