Build file 'C:\Users\bel-i\AndroidStudioProjects\Telegram…
Rate quality
Private research annotation
Sign in to add a private research label or note.
- User
Build file 'C:\Users\bel-i\AndroidStudioProjects\Telegram Desktop\MYapp_9\MYapp_9\app\build.gradle' line: 2
An exception occurred applying plugin request [id: 'com.android.application']
Failed to apply plugin 'com.android.internal.application'. Android Gradle plugin requires Java 17 to run. You are currently using Java 11. Your current JDK is located in C:\Program Files\Android\Android Studio\jbr You can try some of the following options: - changing the IDE settings. - changing the JAVA_HOME environment variable. - changing
org.gradle.java.homeingradle.properties.- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
- Assistant
The error message indicates that the Android Gradle plugin requires Java 17 to run, but the currently installed version of Java is Java 11. There are a few options to resolve this issue:
-
Upgrade to Java 17: Install Java 17 and update the JAVA_HOME environment variable to point to the new installation directory.
-
Update IDE settings: Check the IDE settings and update the JDK used by Android Studio to Java 17.
-
Update gradle.properties: Update the
org.gradle.java.homeproperty in thegradle.propertiesfile to point to the Java 17 installation directory.
After making any of these changes, rebuild the project to see if the issue persists.
-
- User
как это лешече всего сделать?
- Assistant
Вот пошаговая инструкция, как можно обновить версию Java в Android Studio до Java 17:
-
Скачайте и установите версию Java 17 с официального сайта Oracle: https://www.oracle.com/java/technologies/downloads/
-
Найдите установочную директорию Java 17 (обычно это будет что-то вроде C:\Program Files\Java\jdk-17).
-
Откройте Android Studio и перейдите в File -> Project Structure.
-
Выберите вкладку SDK Location.
-
Найдите поле JDK Location и нажмите на кнопку "..." рядом с ним.
-
В открывшемся диалоговом окне найдите папку с установленной версией Java 17 и выберите ее.
-
Нажмите ОК, чтобы сохранить изменения.
-
Перезагрузите Android Studio.
После выполнения этих шагов, Android Studio будет использовать версию Java 17 для сборки ваших проектов. Если вы все еще столкнулись с ошибкой, попробуйте выполнить другие варианты решения, описанные в первом ответе.
-