skip to Main Content

***This Error coming ***
What went wrong:
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:
– changing the IDE settings.
– changing the JAVA_HOME environment variable.
– changing org.gradle.java.home in gradle.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.

SHA certificate Fingerprint code not show error raising

2

Answers


  1. The error message you’re seeing indicates that you need to use Java 11 with the Android Gradle plugin. Here are the steps you can follow to resolve this issue:

    Download and install Java 11 on your machine if you haven’t already done so.
    Set the JAVA_HOME environment variable to point to the Java 11 installation directory. For example, on a Unix-based system, you can add the following line to your .bashrc file: export JAVA_HOME=/path/to/java11.
    Open the gradle.properties file in your project and add the following line: org.gradle.java.home=/path/to/java11. This tells Gradle to use Java 11 when running your build.
    If you’re using Android Studio, go to File > Project Structure > Project and set the JDK location to the Java 11 installation directory. If you’re using a different IDE, check its documentation for instructions on how to set the JDK location.
    Once you’ve made these changes, try running your build again. It should now use Java 11 and the Android Gradle plugin should work correctly.

    Login or Signup to reply.
  2. Navigate to androidbuild.gradle.
    Update the version to the latest and try to run your project again

    dependencies {
            classpath 'com.android.tools.build:gradle:7.0.4'
        }
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search