본문 바로가기
안드로이드

[Android] Gradle plugin requires 에러 해결

by 코딩히어로 2022. 1. 12.
728x90

제목


안드로이드 프로젝트에서 다음과 같은 에러가 발생하여

해결방법에 대해 포스팅하도록 하겠습니다.

 

Build file 'D:\Today Work\TN_147_Java_D2xx_for_Android_Demo_Source\app\build.gradle' line: 1

A problem occurred evaluating project ':app'.
> Failed to apply plugin 'com.android.internal.application'.
   > Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
     You can try some of the following options:
       - changing the IDE settings.
       - changing the JAVA_HOME environment variable.
       - changing `org.gradle.java.home` in `gradle.properties`.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

 

먼저 해당 에러에 대한 내용을 살펴보면 현재 사용 중인 Java가 1.8 버전으로

최소 사용 가능한 11 버전으로 설정하라는 의미입니다.

 

설정 방법 자체가 간단해서 순서대로만 따라 하시면 큰 문제없이 해결할 수 있습니다.

 

1. 안드로이드 스튜디오 왼쪽 상단에 File > Setting... 탭 클릭

설명1

 

2. Build, Execution, Deployment 탭에 Gradle을 클릭

설명2

 

3. Gradle JDK 항목에서 에러 부분에서 설정하라는 Java 버전으로 선택

설명3

여기까지 설정하시고 빌드해보시면 깔끔하게 빌드가 되는 것을 확인할 수 있습니다.

728x90
반응형

댓글