Android Compose Has been compiled by a more recent version of the Java Runtime

사용 언어: Kotlin 1.9.21
사용 버전: Android Studio Hedgehog 2023.1.1

안드로이드 컴포즈 Has been compiled by a more recent version of the Java Runtime를 알아보겠습니다.

Unit(단위) 테스트 코드를 작성한 다음, 실행해 보니 이러한 오류가 나왔습니다.

com/example/mypohangapp/CategoryViewModelTest has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 61.0





Java Runtime의 버전이 63.0으로 설정되어 있는데, 현재는 61.0까지 지원한다는 설명입니다. 즉, 버전이 안 맞다가 주요 내용입니다.


Java Runtime 버전을 찾아보니 이렇습니다.

63.0이니 Java 19를 사용하고 있다는 말인데, 지원하는 것은 61.0인 Java 17이라는 뜻입니다.





Android Studio에 설정을 봅시다.


Settings - Build, Execution, Deployment - Build Tools - Gradle - Gradle JDK를 보면

현재 Runtime version이 17.0.7이 설치된 것을 알 수 있습니다.






저한테는 17.0까지 있는데, 설정을 너무 높게 해버린 거죠.


앱 용 gradle로 옵니다.

아래의 19를 17로 변경합니다.









Sync Now를 누릅니다.









끝.


카테고리: Android, Compose

댓글

이 블로그의 인기 게시물

Python urllib.parse.quote()

Python bytes.fromhex()

Python OpenCV 빈 화면 만들기

Android Notification with Full Screen

Android Minimum touch target size

Android Compose Instrumentation test to unit test

KiCad 시작하기 7 (FreeRoute 사용하기 2)

tensorflow tf.expand_dims()

딩기 요트 명칭

Android AVD Ram size change