Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.
2022. 6. 30. 12:32ㆍAndroid/Bug
문제발생
* What went wrong:
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.
Your current JDK is located in C:\Program Files\Java\jre1.8.0_311
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`.
1차 시도
File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle Gradle JDK 값을 11로 바꾼다.
실행 : .\gradlew -q dependencies test:dependencies --configuration compile
결과 : 동작 안됨
2차 시도
gradle.properties 에 직접 JDK 11 버전 경로 직접 적용
org.gradle.java.home=C:\\Program Files\\Android\\Android Studio\\jre
결과 : 동작됨