Navjot Singh
Navjot Singh

Reputation: 1

How I can fix error in android file in vs code?

1

it is showing: Could not run phased build action using connection to Gradle distribution 'https://services.gradle.org/distributions/gradle-7.4-all.zip'. org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'android'. A problem occurred configuring root project 'android'. A problem occurred evaluating root project 'android'. A problem occurred configuring project ':app'. A problem occurred evaluating project ':app'. 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:

Upvotes: 0

Views: 939

Answers (1)

JialeDu
JialeDu

Reputation: 9863

Follow the steps below to install Java11 in VS code.

  1. Ctrl+Shift+P open command palette
  2. search and select Java: Configure Java Runtime enter image description here
  3. Click download to download other versions enter image description here
  4. Select Java11 in the new window, then click the Download button to start the download enter image description here
  5. Your default browser will open and start downloading Java 11 enter image description here
  6. After the download is complete, run the file to start the installation enter image description here
  7. After the installation is complete, click the Reload Window at the bottom of the picture shown in step 4 to restart VS Code
  8. Select Java11 in the drop down options enter image description here

Upvotes: 0

Related Questions