SmartToolFactory / Compose-Colorful-Sliders

🚀🌈 😍 Colorful Sliders written with Jetpack Compose that enliven default sliders with track and thumb dimensions, and gradient colors, borders, labels on top or at the bottom move with thumb and ColorfulIconSlider that can display emoji or any Composable as thumb
Apache License 2.0
183 stars 12 forks source link

Crash occurred after updating compose 1.4.0-alpha04 and material3 1.1.0-alpha-alpha04 libraries #12

Closed mcnarek closed 1 year ago

mcnarek commented 1 year ago

Slider version is: com.github.SmartToolFactory:Compose-Colorful-Sliders:1.1.0 (older version also has same problem)

FATAL EXCEPTION: main Process: health.humanity.android.dev, PID: 28489 java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/material/TouchTargetKt; at com.smarttoolfactory.slider.MinimumTouchKt$minimumTouchTargetSize$2.invoke(MinimumTouch.kt:27) at com.smarttoolfactory.slider.MinimumTouchKt$minimumTouchTargetSize$2.invoke(MinimumTouch.kt:19) at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:265) at androidx.compose.ui.ComposedModifierKt$materialize$result$1.invoke(ComposedModifier.kt:260) at androidx.compose.ui.Modifier$Element.foldIn(Modifier.kt:115) at androidx.compose.ui.CombinedModifier.foldIn(Modifier.kt:280) at androidx.compose.ui.CombinedModifier.foldIn(Modifier.kt:280) at androidx.compose.ui.ComposedModifierKt.materialize(ComposedModifier.kt:260) at androidx.compose.ui.layout.SubcomposeLayoutKt.SubcomposeLayout(SubcomposeLayout.kt:110) at androidx.compose.ui.layout.SubcomposeLayoutKt.SubcomposeLayout(SubcomposeLayout.kt:75) at androidx.compose.foundation.layout.BoxWithConstraintsKt.BoxWithConstraints(BoxWithConstraints.kt:67) at com.smarttoolfactory.slider.ColorfulSliderKt.ColorfulSlider-rpZKZhI(ColorfulSlider.kt:168)

dsahm commented 1 year ago

When will this fix be released and the depending libraries like Compose-Color-Picker-Bundle be updated with the new version? The crash also occurs there. Thanks!

harunagic commented 1 year ago

having the same issue

armutyus commented 1 year ago

If anyone still looking for a solution, here is how i solved:

add below code to your app level build.gradle file, into the android section before dependencies

configurations.all { resolutionStrategy.cacheChangingModulesFor 0, 'seconds' resolutionStrategy.force 'com.github.SmartToolFactory:Compose-Colorful-Sliders:master-SNAPSHOT' }

then change sliders dependency like this:

implementation 'com.github.SmartToolFactory:Compose-Colorful-Sliders:master-SNAPSHOT'

then everything should be fine with latest compose version

NunoPalma commented 1 year ago

@SmartToolFactory could you have a look at this?

Tejpbit commented 1 year ago

Thanks @armutyus! That works. This part was enough for me: implementation 'com.github.SmartToolFactory:Compose-Colorful-Sliders:master-SNAPSHOT' I didn't need the configurations.all block .

However I'm hesitant to pointing to a dependency that will dynamically change for my production build. How far is this repository from doing a release, @SmartToolFactory? A new one would be really appreciated!

SmartToolFactory commented 1 year ago

1.2.0 is released with thanks to all contributors help. I will also update jetpack compose version to 1.4.3 in version 1.2.1. Also have some plans to re-write slider using M3 slider source code as reference instead of M2.

NunoPalma commented 10 months ago

@SmartToolFactory was the master-SNAPSHOT delete? Version 1.2.0 seems to have a different issue with material3:1.2.0-alpha06. Any chance you can get the previous snapshot back online?