👌
【Android】Android Gradle plugin requires Java 11 to run の対処法
アプリを実行すると以下のエラーが発生しました。
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 Studio
のPreferences
を開く
command + ,
でも開けます。
Build, Execution, Deployment > Build Tools > Gradle
を開く
Gradle JDK
から11 version 11.0.10
を選択します。
これでアプリが実行出来ると思います!
Discussion