Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8.

在 build 舊的 android project 時遇到錯誤訊息:

> 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 --scan to get full insights.

解法:

If JVM points to version 1.8 then you should change it in settings. You can find it in Preferences > Build, Execution, Deployment > Build Tools > Gradle > Gradle JDK

資料來源:

Android Gradle plugin requires Java 11 to run. You are currently using Java 1.8
https://stackoverflow.com/questions/66980512/android-gradle-plugin-requires-java-11-to-run-you-are-currently-using-java-1-8

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *