hi-manshu / Kalendar

Kalendar is a powerful and customizable calendar library for Android applications. It provides a flexible and intuitive way to display and interact with calendars in your app. With Kalendar, you can easily render calendar views, handle date selection, pagination, and range selection, and customize the layout to match your app's design.
https://www.himanshoe.com
Apache License 2.0
761 stars 66 forks source link

Error "java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/animation/AnimatedContentScope;" #131

Closed coccalis closed 1 year ago

coccalis commented 1 year ago

Kalendar( currentDay = today, kalendarType = KalendarType.Firey, modifier = Modifier, showLabel = true, events = KalendarEvents(), kalendarHeaderTextKonfig = null, kalendarColors = KalendarColors.default(), kalendarDayKonfig = KalendarDayKonfig.default(), daySelectionMode = DaySelectionMode.Single, dayContent = null, headerContent = null, onDayClick = { selectedDay, events -> // Handle day click event }, onRangeSelected = { selectedRange, events -> // Handle range selection event }, onErrorRangeSelected = { error -> // Handle error })

rohitjakhar commented 1 year ago

same issue with me.

hi-manshu commented 1 year ago

Hey @rohitjakhar @coccalis , What is the Compose version are you on?

rohitjakhar commented 1 year ago

implementation platform('androidx.compose:compose-bom:2023.05.01') kotlinCompilerExtensionVersion '1.4.6'

these.

peporroncin commented 1 year ago

Hi!,

Same issue with me.

implementation platform('androidx.compose:compose-bom:2023.05.01') kotlinCompilerExtensionVersion '1.4.1'

Error: java.lang.NoSuchMethodError: No static method AnimatedContent(Ljava/lang/Object;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Alignment;Ljava/lang/String;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 ...) at com.himanshoe.kalendar.ui.component.header.KalendarHeaderKt.KalendarHeader(KalendarHeader.kt:87) at com.himanshoe.kalendar.ui.firey.KalendarFireyKt.KalendarFirey(KalendarFirey.kt:118) at com.himanshoe.kalendar.KalendarKt.Kalendar(Kalendar.kt:136)

hi-manshu commented 1 year ago

Hey will check it later today.

peporroncin commented 1 year ago

Hi!

any updates?

hi-manshu commented 1 year ago

Yes, and should push a fix by tonight or tomorrow!

hi-manshu commented 1 year ago

https://github.com/hi-manshu/Kalendar/releases/tag/v1.3.2 This should be fixed in this!

peporroncin commented 1 year ago

Hi,

I've updated version to 1.3.2 but the issue continues.

This is the logcat error:

java.lang.NoSuchMethodError: No static method AnimatedContent(Ljava/lang/Object;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Alignment;Ljava/lang/String;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 /data/app/~~McmB8z3HIZ136tq4KHO-9Q==/-51h2Mr0mubO16KkbvCby0w==/base.apk) at com.himanshoe.kalendar.ui.component.header.KalendarHeaderKt.KalendarHeader(KalendarHeader.kt:87) at com.himanshoe.kalendar.ui.firey.KalendarFireyKt.KalendarFirey(KalendarFirey.kt:118) at com.himanshoe.kalendar.KalendarKt.Kalendar(Kalendar.kt:136)

I'm using this Kalendar:

    Kalendar(
        currentDay = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()).date,
        kalendarType = KalendarType.Firey,
        modifier = Modifier,
        showLabel = true,
        events = KalendarEvents(),
        kalendarHeaderTextKonfig = null,
        daySelectionMode = DaySelectionMode.Single,
        dayContent = null,
        headerContent = null,
    )
peporroncin commented 1 year ago

Hi again,

I've found the issue. It was an incompatibility between the Compose and Accompanist libraries that I was using in the project.

I was using this:

implementation platform("androidx.compose:compose-bom:2023.05.01") implementation "com.google.accompanist:accompanist-permissions:0.31.3-beta"

But the accompanist library v0.31.3-beta works with Compose UI 1.5 (1.5.x) and compose-bom:2023.05.01 works with Compose 1.4.x.

Now I've change the libraries by these versions and everything works well, because the accompanist library v0.30.1 works with Compose UI 1.4 (1.4.x)

implementation platform("androidx.compose:compose-bom:2023.05.01") implementation 'com.google.accompanist:accompanist-permissions:0.30.1'

I hope that it can help to someone.

Thanks by this wonderful "Kalendar".

hi-manshu commented 1 year ago

Awesome, thanks! Hope this helps. Any other feature you wanna see?

Jonakyll commented 11 months ago

Hi, i am using the v1.3.2 and getting this error too: java.lang.NoSuchMethodError: No static method AnimatedContent(Ljava/lang/Object;Landroidx/compose/ui/Modifier;Lkotlin/jvm/functions/Function1;Landroidx/compose/ui/Alignment;Ljava/lang/String;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 /data/app/~~f0Ailj78fmB7zkVSDVaIUA==/com.mmmeat.mmmpro.dev-ezhCUn494SAO4JOv-1IAlQ==/base.apk)

I am not using accompanist or bom val today = LocalDate.now() Kalendar( currentDay = today, kalendarType = KalendarType.Firey, modifier = Modifier, showLabel = true, events = KalendarEvents(), kalendarHeaderTextKonfig = null, kalendarColors = KalendarColors.default(), kalendarDayKonfig = KalendarDayKonfig.default(), daySelectionMode = DaySelectionMode.Single, dayContent = null, headerContent = null, onDayClick = { selectedDay, events -> // Handle day click event }, onRangeSelected = { selectedRange, events -> // Handle range selection event }, onErrorRangeSelected = { error -> // Handle error })

hi-manshu commented 11 months ago

Did you try the above mentioned solution?

https://github.com/hi-manshu/Kalendar/issues/131#issuecomment-1581263364

Jonakyll commented 11 months ago

yes, i put the versions mentioned but get the same error. I think this is related to compose-animation, so i tried to add the lib in my project, but still having the java.lang.NoSuchMethodError: No static method AnimatedContent