An exception occurred applying plugin request [id: 'com.android.application']
Android studio 를 최신버전(Arctic Fox) 으로 update 후 신규 프로젝트를 만들었는데 이상한 에러가 발생했다.
이번 포스팅에서는 해당 오류를 해결하는 방법에 대해 알아보자
Error message
An exception occurred applying plugin request [id: 'com.android.application']
> 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`.
Cause
안드로이드 스튜디오 설치 후 실행한 신규 프로젝트의 Android gradle plugin 이 7 인데 해당 버전 Java 11 이 필요하다고 한다.
위 에러 메시지에도 Java 11 이 필요하다고 명시되어 있다.
(Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.)
Solution
Gradle JDK version 을 11 로 설정해 주자.
◼ File -> Settings -> Build, Execution, Deployment, Build Tools -> Gradle