30
Help us understand the problem. What are the problem?

More than 1 year has passed since last update.

Android Gradle plugin requires Java 11と言われてSyncできないときの対処法

AGP 7.0.0-alpha02からJava 11が必須になったようです。
https://developers-jp.googleblog.com/2020/12/announcing-android-gradle-plugin.html
あの設定どこだっけってときどきなって、かなり高確率で最初に当たるので、メモしておきます。

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

Gradleの設定を開いて、

image.png
image.png

Android Studioに入っているJDKを選ぶだけです。

image.png

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Sign upLogin
30
Help us understand the problem. What are the problem?