androidkotlinmaterial-uiandroid-jetpack-composeprogress

Android Compose CircularProgressIndicator crashing with latest material


This is what I use in my top level build.gradle

buildscript {
ext.kotlin_version = '1.9.22'
ext.compose_version = '1.5.8'

This is in my app/build.gradle:

 //compose
implementation platform('org.jetbrains.kotlin:kotlin-bom:1.8.0')
implementation platform('androidx.compose:compose-bom:2023.10.01')
implementation 'androidx.compose.ui:ui'
implementation 'androidx.compose.ui:ui-graphics'
implementation 'androidx.compose.ui:ui-tooling-preview'
implementation 'androidx.lifecycle:lifecycle-runtime-compose'
implementation "androidx.compose.material:material:1.6.0-rc01"
implementation 'androidx.compose.material3:material3'
implementation "androidx.compose.runtime:runtime-livedata:1.6.0-rc01"
implementation "androidx.constraintlayout:constraintlayout-compose:1.1.0-alpha13"
debugImplementation 'androidx.compose.ui:ui-tooling'
debugImplementation 'androidx.compose.ui:ui-test-manifest'

When I try to use a :

   CircularProgressIndicator()

I get:

 2024-01-11 10:54:02.011 19971-19971 AndroidRuntime          com.xelion8.android.debug            E  FATAL EXCEPTION: main
                                                                                                Process: com.xelion8.android.debug, PID: 19971
                                                                                                java.lang.NoSuchMethodError: No virtual method at(Ljava/lang/Object;I)Landroidx/compose/animation/core/KeyframesSpec$KeyframeEntity; in class Landroidx/compose/animation/core/KeyframesSpec$KeyframesSpecConfig; or its super classes (declaration of 'androidx.compose.animation.core.KeyframesSpec$KeyframesSpecConfig' appears in /data/app/~~zMOkip4n5Wz8Fm2urYiXpw==/com.xelion8.android.debug-CITlVzR2VOZRFOGKeJzkEw==/base.apk)
                                                                                                    at androidx.compose.material3.ProgressIndicatorKt$CircularProgressIndicator$endAngle$1.invoke(ProgressIndicator.kt:302)
                                                                                                    at androidx.compose.material3.ProgressIndicatorKt$CircularProgressIndicator$endAngle$1.invoke(ProgressIndicator.kt:300)
                                                                                                    at androidx.compose.animation.core.AnimationSpecKt.keyframes(AnimationSpec.kt:649)
                                                                                                    at androidx.compose.material3.ProgressIndicatorKt.CircularProgressIndicator-aM-cp0Q(ProgressIndicator.kt:300)
                                                                                                    at com.xelion.android.view.composables.CommunicationComposables.DownloadingAttachment(CommunicationComposables.kt:950)
                                                                                                    at com.xelion.android.view.composables.CommunicationComposables.Attachment-tVxRRlI(CommunicationComposables.kt:556)
                                                                                                    at com.xelion.android.view.composables.CommunicationComposables$CommunicationCard$3$2.invoke(CommunicationComposables.kt:409)
                                                                                                    at com.xelion.android.view.composables.CommunicationComposables$CommunicationCard$3$2.invoke(CommunicationComposables.kt:388)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:118)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                    at androidx.compose.material3.CardKt$Card$1.invoke(Card.kt:806)
                                                                                                    at androidx.compose.material3.CardKt$Card$1.invoke(Card.kt:92)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                    at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:129)
                                                                                                    at androidx.compose.material3.SurfaceKt$Surface$1.invoke(Surface.kt:113)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                    at androidx.compose.runtime.CompositionLocalKt.CompositionLocalProvider(CompositionLocal.kt:228)
                                                                                                    at androidx.compose.material3.SurfaceKt.Surface-T9BRK9s(Surface.kt:110)
                                                                                                    at androidx.compose.material3.CardKt.Card(Card.kt:84)
                                                                                                    at com.xelion.android.view.composables.CommunicationComposables$CommunicationCard-RRe_7Rc$$inlined$ConstraintLayout$5.invoke(ConstraintLayout.kt:2389)
                                                                                                    at com.xelion.android.view.composables.CommunicationComposables$CommunicationCard-RRe_7Rc$$inlined$ConstraintLayout$5.invoke(ConstraintLayout.kt:471)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                    at androidx.compose.ui.layout.LayoutKt.MultiMeasureLayout(Layout.kt:463)
                                                                                                    at com.xelion.android.view.composables.CommunicationComposables.CommunicationCard-RRe_7Rc(CommunicationComposables.kt:1382)
                                                                                                    at com.xelion.android.view.composables.CommunicationComposables$CommunicationList$3$1$invoke$$inlined$items$default$4.invoke(LazyDsl.kt:467)
                                                                                                    at com.xelion.android.view.composables.CommunicationComposables$CommunicationList$3$1$invoke$$inlined$items$default$4.invoke(LazyDsl.kt:148)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:139)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:35)
                                                                                                    at androidx.compose.foundation.lazy.LazyListItemProviderImpl$Item$1.invoke(LazyListItemProvider.kt:79)
                                                                                                    at androidx.compose.foundation.lazy.LazyListItemProviderImpl$Item$1.invoke(LazyListItemProvider.kt:77)
                                                                                                    at androidx.compose.runtime.internal.ComposableLambdaImpl.invoke(ComposableLambda.jvm.kt:109)

Solution

  • This can be solved by

    That should fix the crash issue with CircularProgressIndicator