👌

【Android】Android Gradle plugin requires Java 11 to run の対処法

2021/08/18に公開

アプリを実行すると以下のエラーが発生しました。

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`.

対処法

Java 11を選択することで解決します

Android StudioPreferencesを開く

command + ,でも開けます。

Build, Execution, Deployment > Build Tools > Gradleを開く

Gradle JDKから11 version 11.0.10を選択します。


これでアプリが実行出来ると思います!

Discussion

ログインするとコメントできます