Skip to content

FATAL EXCEPTION: main in Compose Version 1.6.8 #10

@Ericgacoki

Description

@Ericgacoki

Description

I'm working on a Music Streaming App and this library has been incredibly helpful. However, an update to a transitive dependency upgraded my Compose version from 1.5.1 to the latest 1.6.8 (as of July 23, 2024). It appears that Google has made some Slider components private in this version. Can you help me find a workaround for this issue? The proposed fix in #7 doesn't seem to work.

My Implementation

WaveSlider(
    modifier = Modifier.height(12.dp),
    value = seekPosition,   // state hoisted in a ViewModel
    onValueChange = { value ->
        onSeekPlayBack(value)
    },
    waveOptions = WaveSliderDefaults.waveOptions(
        amplitude = 12F,
        frequency = 0.07F
    ),
    thumb = { PillThumb() },
    animationOptions = WaveSliderDefaults.animationOptions(
        reverseDirection = false,
        flatlineOnDrag = true,
        animateWave = animateWave,
        reverseFlatline = false
    ),
    colors = WaveSliderDefaults.colors(
        inactiveTrackColor = MaterialTheme.colorScheme.inverseOnSurface
    )
)

Error

FATAL EXCEPTION: main
Process: com.android.swingmusic, PID: 10067
java.lang.NoSuchMethodError: No static method
Slider(FLkotlin/jvm/functions/Function1;Landroidx/compose/ui/Modifier;ZLkotlin/ranges/ClosedFloatingPointRange;Lkotlin/jvm/functions/Function0;Landroidx/compose/material3/SliderColors;Landroidx/compose/foundation/interaction/MutableInteractionSource;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ILandroidx/compose/runtime/Composer;III)V
in class Landroidx/compose/material3/SliderKt; or its super classes (declaration of
'androidx.compose.material3.SliderKt' appears in
/data/app/~~hsIXHYVNljfimgOBwNYmUw==/com.android.swingmusic-CvbzKCHUiz6oiMzGcnFxbQ==/base.apk!classes23.dex)
at com.galaxygoldfish.waveslider.WaveSliderKt.WaveSlider(WaveSlider.kt:110)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions