관리 메뉴

나만을 위한 블로그

[Android Compose] CircularProgressIndicator 에러 해결 본문

Android/Compose

[Android Compose] CircularProgressIndicator 에러 해결

참깨빵위에참깨빵 2024. 2. 24. 23:36
728x90
반응형

Compose로 앱을 만들던 중 CircularProgressIndicator를 써서 로딩 뷰를 구현하고 실행했더니 아래 에러가 발생했다.

 

android 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/~~TQE4TsSdcjzwQA-H9OnaQw==/com.example.composenewsapp-Xq7slhbcIV4OncTKJBz-3w==/base.apk)

 

이 에러에 대한 스택오버플로우의 답변은 아래와 같다.

 

https://stackoverflow.com/a/77347462

 

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) Lan...

stackoverflow.com

 

앱 gradle의 material3:material3-android 라이브러리의 최신 버전 또는 작동이 확인되는 버전을 사용하면 된다고 한다.

오늘 날짜인 24.02.24 기준으로 stable 버전은 1.2.0이기에 난 아래와 같이 수정했다.

 

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

 

이후 앱을 재실행하니 정상적으로 프로그레스 바가 표시되고 위의 에러도 발생하지 않았다.

위 라이브러리의 stable 버전, 최신 버전은 아래의 디벨로퍼 링크에서 볼 수 있다.

 

https://developer.android.com/jetpack/androidx/releases/compose-material3?hl=ko

 

Compose Material 3  |  Jetpack  |  Android Developers

이 페이지는 Cloud Translation API를 통해 번역되었습니다. 컬렉션을 사용해 정리하기 내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요. Compose Material 3 차세대 Material Design인 Material Design 3 구성

developer.android.com

 

반응형
Comments