mahozad / wavy-slider

Multiplatform wavy slider/progress bar similar to the one in Android 13
https://mahozad.ir/wavy-slider
Apache License 2.0
159 stars 3 forks source link

Material3 1.3 alpha breaks the library: NoSuchMethodError: No virtual method updateDimensions$material3_release #17

Closed dokar3 closed 2 months ago

dokar3 commented 5 months ago

I am trying to integrate this nice library into one of my apps, as you suggested here https://github.com/dokar3/amlv/issues/5.

However, when using it with the latest version of compose material3, it crashed:

java.lang.NoSuchMethodError: No virtual method updateDimensions$material3_release(FI)V in class Landroidx/compose/material3/SliderState; or its super classes (declaration of 'androidx.compose.material3.SliderState' appears in /data/app/~~8QKdEh38z4CLdW726fQCvQ==/com.dokar.upnextgpt-gluA86yOd25GvGrvJB57Yg==/base.apk)
    at ir.mahozad.multiplatform.wavyslider.material3.WavySliderKt$WavySliderImpl$2$1.measure-3p2s80s(WavySlider.kt:596)
    at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(InnerNodeCoordinator.kt:135)
    at androidx.compose.foundation.layout.SizeNode.measure-3p2s80s(Size.kt:838)
    at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:188)
    at androidx.compose.material3.MinimumInteractiveModifierNode.measure-3p2s80s(InteractiveComponentSize.kt:82)
    at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:188)
    at androidx.compose.foundation.layout.FillNode.measure-3p2s80s(Size.kt:699)
    at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(LayoutModifierNodeCoordinator.kt:188)
    at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:316)
    at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(LayoutNodeLayoutDelegate.kt:315)
    at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Snapshot.kt:501)

I believe that's because material3 1.3 has changed a lot, I have faced a similar issue due to the material3 API changes https://github.com/dokar3/ChipTextField/issues/145. I hope this will help.

mahozad commented 5 months ago

Thanks for raising the issue and the relevant information.

The material 3 1.3 alpha has not been yet merged to compose multiplatform (I think they only use stable versions).

Do you know how I can override version of material 3 library used in compose multiplatform project?

I will try to see if an alpha version of wavy slider can be published.

dokar3 commented 5 months ago

Thanks for the fast response!

Do you know how I can override version of material 3 library used in compose multiplatform project?

In the ChipTextField library, I was stuck on this approach and eventually had to rewrite some functions to get rid of the removed m3 API. I have to say that compose material3 might be a nightmare for library authors, kinda sad.

mahozad commented 2 months ago

It should be fixed in wavy slider 2.0.0-alpha.

dokar3 commented 2 months ago

The new version works well! Thanks!