halilozercan/compose-richtext

Crash when using Slideshow

Closed this issue · 3 comments

Crash when using slideshow library and latest compose version (currently 1.1.0-alpha03). Rest richtext libraries are working correctly.

java.lang.NoSuchMethodError: No static method AnimatedVisibility(ZLandroidx/compose/ui/Modifier;Landroidx/compose/animation/EnterTransition;Landroidx/compose/animation/ExitTransition;Lkotlin/jvm/functions/Function3;Landroidx/compose/runtime/Composer;II)V in class Landroidx/compose/animation/AnimatedVisibilityKt; or its super classes (declaration of 'androidx.compose.animation.AnimatedVisibilityKt' appears in /data/data/xxx/code_cache/.overlay/base.apk/classes.dex)
        at com.zachklipp.richtext.ui.slideshow.SlideshowKt$Slideshow$5$1$1.invoke(Slideshow.kt:165)
        at com.zachklipp.richtext.ui.slideshow.SlideshowKt$Slideshow$5$1$1.invoke(Slideshow.kt:134)
        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.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:215)
        at androidx.compose.material.TextKt.ProvideTextStyle(Text.kt:252)
        at com.zachklipp.richtext.ui.slideshow.SlideshowKt$Slideshow$5$1.invoke(Slideshow.kt:134)
        at com.zachklipp.richtext.ui.slideshow.SlideshowKt$Slideshow$5$1.invoke(Slideshow.kt:133)
        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.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:215)
        at com.zachklipp.richtext.ui.slideshow.SlideshowKt.Slideshow(Slideshow.kt:130)
        at ...

I'm not sure what would be the exact cause of this issue but compose-richtext is officially compatible with Jetpack Compose 1.0.1 . We are not planning to have builds that support the alpha channel.

Hmm this is probably a compatibility issue of kotlin versions instead of compose versions. Latest alpha now supports 1.5.30 and latest stable 1.5.21 I think as animatedvisibility function hasn't changed.
Thanks.

Just copy source code from Slideshow file to your project.
I did exactly that and the problem is solved. this works with alpha04