티스토리 뷰

상황

github에서 가져온 프로젝트를 빌드할 때 다음과 같은 에러가 발생하였습니다.

Caused by: com.android.builder.errors.EvalIssueException: 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`.
	at com.android.builder.errors.IssueReporter.reportError(IssueReporter.kt:109)
	at com.android.builder.errors.IssueReporter.reportError$default(IssueReporter.kt:105)
	at com.android.builder.errors.IssueReporter.reportError(IssueReporter.kt)
	at com.android.build.gradle.internal.plugins.BasePlugin.checkMinJvmVersion(BasePlugin.java:951)
	at com.android.build.gradle.internal.plugins.BasePlugin.basePluginApply(BasePlugin.java:291)
	at com.android.build.gradle.internal.plugins.BasePlugin.lambda$apply$0(BasePlugin.java:274)
	at com.android.build.gradle.internal.crash.CrashReporting.runAction(crash_reporting.kt:27)
	at com.android.build.gradle.internal.plugins.BasePlugin.apply(BasePlugin.java:272)
	at com.android.build.gradle.internal.plugins.BasePlugin.apply(BasePlugin.java:150)
	at org.gradle.api.internal.plugins.ImperativeOnlyPluginTarget.applyImperative(ImperativeOnlyPluginTarget.java:43)
	at org.gradle.api.internal.plugins.RuleBasedPluginTarget.applyImperative(RuleBasedPluginTarget.java:51)
	at org.gradle.api.internal.plugins.DefaultPluginManager.addPlugin(DefaultPluginManager.java:187)
	at org.gradle.api.internal.plugins.DefaultPluginManager.access$100(DefaultPluginManager.java:52)
	at org.gradle.api.internal.plugins.DefaultPluginManager$AddPluginBuildOperation.run(DefaultPluginManager.java:282)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
	at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
	at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:74)
	at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
	at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:74)
	at org.gradle.api.internal.plugins.DefaultPluginManager.lambda$doApply$0(DefaultPluginManager.java:167)
	at org.gradle.configuration.internal.DefaultUserCodeApplicationContext.apply(DefaultUserCodeApplicationContext.java:44)
	at org.gradle.api.internal.plugins.DefaultPluginManager.doApply(DefaultPluginManager.java:166)
	... 176 more

 

원인

해당 프로젝트의 Gradle 플러그인 실행시 Java11이 필요한데 현재 Java1.8로 설정되어 있어 발생

 

해결

설정 페이지 이동 경로 설명 이미지
<설정 페이지 이동>

안드로이드 스튜디오에서 [File > Setting...] 를 클릭하여 설정 페이지로 이동합니다.

JDK 버전 설정 방법 이미지
<JDK 버전 설정>

설정 페이지에서 [Build, Execution, Deployment > Build Tools > Gradle] 로 이동합니다.
1.8로 설정되어 있는 Gradle JDK를 11로 변경합니다.
OK 버튼을 클릭하여 변경 값을 적용합니다.

 

이제 정상적으로 빌드가 되는지 확인해봅시다!

반응형
댓글
최근에 올라온 글
최근에 달린 댓글