Android current target is 17 error

사용 언어: Kotlin 1.8.10

사용 버전: Android Studio Flamingo 2022.2.1


안드로이드 current target is 17 error를 알아보겠습니다.


안드로이드 스튜디오에서 플라밍고 Flamingo 버전을 출시했습니다.







그냥 빌드 하면 이렇게 오류가 발생합니다.

Execution failed for task ':app:kaptGenerateStubsDebugKotlin'.

> 'compileDebugJavaWithJavac' task (current target is 11) and 'kaptGenerateStubsDebugKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.

  Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain







What's new 부분에 보시면, JDK 17이 필요하다고 적혀있습니다.







File - Project Structure...로 갑니다.






SDK Location으로 갑니다. JDK location was moved to Gradle Settings.를 누릅니다.








Download JDK...를 누릅니다.







저는 Amazon Corretto로 사용해 보기로 했습니다.







이제, OK를 누르면 됩니다.







앱 용 build.gradle로 가서 sourcecompatibility, targetcomaptibility, jvmTarget 등을 JavaVersion.VERSION_17로 변경합니다.






끝.



카테고리: Android


댓글

이 블로그의 인기 게시물

Python OpenCV 빈 화면 만들기

Python urllib.parse.quote()

Python bytes.fromhex()

Android AVD Ram size change

Forensics .pyc 파일 .py로 복구하기

Android Minimum touch target size

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

Android Notification with Full Screen

C++ OpenCV 모폴로지 침식, 팽창

KiCad 시작하기 2 (PCB 만들기)