Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't add ProgressIndicators (app crashes)

When I use any kind of Progress Indicators like CircularProgressIndicator() or LinearProgressIndicator() my app crashes:

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/~~rlFP4ThDS2yjsD1Xsh1cWQ==/es.jvbabi.vplanplus-6LDitHOwZpwGZt8Ywx6lFQ==/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)

These are my dependencies relevant to this issue:

implementation("androidx.core:core-ktx:1.12.0")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.6.2")
implementation("androidx.activity:activity-compose:1.8.0")
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")

No matter where I put them, they cause the app to crash.

like image 339
Julius Babies Avatar asked Sep 02 '25 09:09

Julius Babies


2 Answers

Using this version (confirmed it works) or a newer one should fix the issue. See all versions on mvnrepository

implementation("androidx.compose.material3:material3-android:1.2.0-alpha10")
like image 81
Julius Babies Avatar answered Sep 04 '25 23:09

Julius Babies


It's a known issue https://issuetracker.google.com/issues/322214617 As a temporary solution, you can use this declaration in your Gradle file

implementation("androidx.compose.material3:material3-android:1.2.0-rc01")

instead of

implementation("androidx.compose.material3:material3")
like image 30
Oleh Kuchura Avatar answered Sep 05 '25 00:09

Oleh Kuchura