hi-manshu/Kalendar

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

coccalis opened this issue ยท 14 comments

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
})

same issue with me.

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

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

these.

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)

Hey will check it later today.

Hi!

any updates?

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

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,
    )

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".

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

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
})

Did you try the above mentioned solution?

#131 (comment)

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