I am working on an app. In my app there is no error in code but when I try to run my project it gives following errors.
Error:(1, 1) A problem occurred evaluating project ‘:app’.
Failed to apply plugin [id ‘com.android.application’]
Could not create plugin of type ‘AppPlugin’.
I try this also Gradle is issuing an error «Could not create plugin of type ‘AppPlugin'»
and this also Gradle errors in Android Studio
Following is my build.gradle file
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "21.1.2"
defaultConfig {
applicationId "com.praval.healthfreak"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:design:23.2.1'
compile files('libs/YouTubeAndroidPlayerApi.jar')
}
asked May 7, 2016 at 9:28
![]()
Praval SharmaPraval Sharma
1,7712 gold badges12 silver badges20 bronze badges
8
Updated June 24, 2020
You need to update to the latest gradle version to solve this issue.
Please make sure you are on the latest Android Studio
and then update your project level build.gradle by updating this dependency
buildscript {
repositories {
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
}
}
It might show a popup asking your permission to update gradle, please update and it will download the latest distribution automatically and the issue will be resolved.
Or else you can
Get Latest Gradle 5.6.4 from here and Add it manually
If you don’t want to download it manually:
Open YourProject > gradle > wrapper > gradle-wrapper.properties and replace
distributionUrl=https://services.gradle.org/distributions/gradle-version-number-all.zip
With
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-all.zip
Rebuild the project or just run gradle sync again.
answered May 7, 2016 at 17:19
![]()
10
I faced the same issue in Android Studio version 3.5.3. This is how i fixed it.
I updated the dependecy com.android.tools.build:gradle in my project level build.gradle file from a lower version to 3.5.3 as below.
classpath 'com.android.tools.build:gradle:3.5.3'
I then went ahead and edited the value of distributionUrl in gradle-wrapper.properties file as below. This file is in the directory /gradle/wrapper/ from the root of your project folder.
distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip
answered Jan 7, 2020 at 10:28
![]()
1
I found the simplest answer to this.
Just go gradle.properties file and change the enableUnitTestBinaryResources from true to false
android.enableUnitTestBinaryResources=false
The snapshot is shown below

answered Feb 18, 2021 at 6:44
![]()
TonnieTonnie
3,6813 gold badges25 silver badges38 bronze badges
1
Feb 25th 2021:
For me, after over 8 hours of trials and errors, it was the re-ordering of the repositories sources in the project-level build.gradle file that solved the issue for me. So, instead of:
buildscript {
...
repositories {
google()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
...
}
I moved google() to the bottom:
buildscript {
...
repositories {
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
google()
}
...
}
Of course, be sure to update the gradle android plugin and the matching gradle-wrapper distribution versions too.
answered Feb 25, 2021 at 12:23
![]()
UgoUgo
5208 silver badges11 bronze badges
Delete gradle cache files.
It can be in path like
C:Usersusername.gradlecaches
for Windows users.
For UNIX based operating systems it will be
~/.gradle/caches.
Akito
1172 silver badges7 bronze badges
answered Sep 18, 2018 at 9:35
Cui QingCui Qing
1572 silver badges5 bronze badges
2
Just go to the gradle.properties file and change enableUnitTestBinaryResources from true to false
android.enableUnitTestBinaryResources=false
Paul Roub
36.2k27 gold badges82 silver badges89 bronze badges
answered Aug 17, 2021 at 18:53
i fixed it by upgrade to gradle-5.6.4-all.zip in projectgradlewrappergradle-wrapper.properties
#Wed Mar 11 15:20:29 WAT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip
answered Mar 11, 2020 at 14:56
![]()
Solved it by setting gradle version 3.2.1
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
In Project level Gradle
answered Oct 17, 2018 at 11:52
1
On Mac Just Goto :
Android Studio -> Preference -> Gradle -> Gradle JDK -> Download JDK -> Ok

![]()
answered Jan 6, 2022 at 17:26
![]()
Android Gradle Plugin 7 requires Java 11. use short key Ctr+Alt+Shift+S or Go to File > Project Structure and change JDK location to Embedded JDK.

answered Apr 24, 2022 at 22:28
kksal55kksal55
4307 silver badges14 bronze badges
you just need to change your project.gradle file. And sync your Gradle.
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
}
answered Dec 5, 2016 at 7:47
![]()
2
As in Accepted post, the problem solved with updating gradle to 4.4.1.
- Get Latest Gradle 4.4.1 from here
- Extract and put it in «C:Program FilesAndroidAndroid Studiogradle»
- Then from android studio go to
«File -> Settings -> Build, Excecution, Deployment -> Gradle», from Project-level settings: Select Use local gradle Distribution and give the above
address(folder with name «gradle-4.4.1» in «C:Program Files …») - Then make project.

My Problem solved this way.
answered Feb 27, 2018 at 9:36
![]()
Mahdi MoqadasiMahdi Moqadasi
1,7623 gold badges25 silver badges50 bronze badges
When I had this problem was beacuse my directory had non ASCII characteres. Try changing it
answered May 4, 2020 at 2:32
First update the gradle to the latest version, if the issue still persists (in my case it did) then do the below-
go to gradle.properties file and comment the line
android.enableUnitTestBinaryResources=true
click on sync now.
it should solve the issue.
answered Apr 12, 2021 at 18:28
![]()
In my case, if your version of build tools in the build.gradle file in the root folder like :
classpath ‘com.android.tools.build:gradle:3.x.x’ <— version of tools
is not supported by the Gradle installed in your project, you can check the build tools/plugin supported versions here, and make sure that the version installed in your project is supported by that version of Gradle.
You don’t need to upgrade Gradle, you just check if it supports the plugin installed in your project or not.
![]()
answered Nov 10, 2018 at 15:34
My problem was I had czech characters (č,ú,ů,á,ó) in the project folder path.
answered Mar 10, 2020 at 9:25
Jan MálekJan Málek
5118 silver badges21 bronze badges
I had the same issue and this is what I did and I was able to solve my issue:
- I’m working with ShimmerAndroidAPI ( this library ) with Android Studio 3.6.1.
- This worked well before I upgrade the Gradle and Android Studio to a new version using pop up upgrade suggestions appeared in android studio.
- I followed the below steps as mentioned in this answer and I was able to make the project work.The steps I followed are as below.
-
Gradle file was updated from classpath ‘com.android.tools.build:gradle:3.6.1’ to
classpath ‘com.android.tools.build:gradle:3.1.3’
-
Then distribution URL in gradle-wrapper.properties file was updated from distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip to
distributionUrl=https://services.gradle.org/distributions/gradle-5.4.1-all.zip
-
Gradle was then synched.
answered Mar 17, 2020 at 19:07
![]()
SachzSachz
3715 silver badges20 bronze badges
3
Whenever you update your Gradle files do not forget to check the compatible Gradle wrapper distibutionUrl, in your case it happened because of the same.
distributionUrl=https://services.gradle.org/distributions/gradle-5.6.4-all.zip
answered Apr 22, 2020 at 7:01
![]()
MinionMinion
92412 silver badges16 bronze badges
Inside my project there is a .gradle folder which had cached the previous gradle version I was using (5.4.1) and gradle kept using that instead of my newly downloaded one (5.6.4).
Simply:
- Close Android Studio
- Delete the older gradle version folders from your project.
- Restart Android Studio. Everything should be working correctly
In case this didn’t work you can also try the following:
- Delete all versions in project .gradle folder so only the new one is redownloaded by AS when reopening the IDE.
- Check your project settings for gradle build version and make sure it is set to the latest one.
- Check that other modules aren’t using older versions of the gradle build. You can search for this using project search (Ctrl+Shift+F) for
"distributionUrl"and making sure that all modules have the latest version. - Delete
.gradle/cachesunder your root gradle folder, usuallyC://Users/{you}/.gradle - try
gradle build --stacktrace,--info,--scanor--debugin your AS terminal to get help and more info to debug your problem.
RobC
21.7k20 gold badges66 silver badges75 bronze badges
answered May 25, 2020 at 11:36
![]()
Panos GrPanos Gr
6675 silver badges13 bronze badges
In my case delete your gradle file and then again import your file again it will work
answered Jun 4, 2020 at 9:08
![]()
AqifAqif
2963 silver badges5 bronze badges
delete C:Usersusername.gradlecaches folder.
answered Nov 25, 2019 at 12:24
- flutter clean
- flutter run —debug
- flutter build apk —release
the debug will create the build gradle and building apk will work fine
answered Mar 2, 2021 at 6:16
As of Android Gradle version above 7.0.0, Remove android.enableUnitTestBinaryResources from gradle.properties file
answered Mar 22, 2021 at 10:02
One of the causes of the following error could be that exists an incompatibility with the configured version of the JVM in the project regarding the JDK location.
Error:
org.gradle.api.plugins.InvalidPluginException: An exception occurred applying plugin request [id: 'com.android.application']
Caused by: java.lang.NoSuchMethodException: java.lang.invoke.MethodHandles.privateLookupIn(java.lang.Class, java.lang.invoke.MethodHandles$Lookup)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoSuchMethodException: java.lang.invoke.MethodHandles.privateLookupIn(java.lang.Class, java.lang.invoke.MethodHandles$Lookup)
Caused by: java.lang.NoSuchMethodException: java.lang.invoke.MethodHandles.privateLookupIn(java.lang.Class, java.lang.invoke.MethodHandles$Lookup)
Workaround:
Note: For JVM version in compileOptions{} and kotlinOptions{}
- For JVM version:
JavaVersion.VERSION_1_8 - Use JDK Location:
/java-1.8.0-openjdk-amd64
- For JVM version:
JavaVersion.VERSION_11 - Use JDK Location:
/java-1.11.0-openjdk-amd64
![]()
Dharman♦
29.2k21 gold badges79 silver badges131 bronze badges
answered Mar 23, 2021 at 1:11
Braian CoronelBraian Coronel
21.6k4 gold badges53 silver badges58 bronze badges
Try this simple and quick solution.
Invalidating cache solved my problem.
Just go to File>Invalidate Cache /Restart.
answered May 9, 2021 at 15:01
![]()
I am facing same issue.
But I am able to run app from Android Studio
- First, in a terminal/command-prompt, open Metro-Bundler, by running command:
npm startfrom project folder (Ex: D:AwesomeProject>npm start) - Then in Android Studio, open ~/ProjectFolder/android (Ex: D:AwesomeProjectandroid), and click Play icon (or press Shift+F10 for windows).
Note: This worked on Emulator only.
answered Apr 9, 2022 at 19:02
![]()
This answer is only valid if you cloned your project. For example. I had an app for USA only and wanted to clone it for other countries. I copied the project then renamed each project folder with country name. The names were already in excel so using copy-paste some projects gave me this error. When I sorted by name, I noticed the problematic ones were not in the correct alphabetical position.
So if this happened to you after cloning or renaming an existing project folder in file explorer (especially if you made names in excel and copy pasted) it introduces non-ascii characters.
- Close android studio
- Navigate to project location (in my case D://published apps/project name)
- right click and rename the project name without using paste, instead type it.
- When you open android studio again it should work, otherwise follow the other answers above.
TIP: It helps if you have multiple folders as you can sort by name and see project names that do not adhere to alphabetical order.
answered Jul 20, 2022 at 10:36
![]()

Hello,
I am Dipak, I faced this issue because I have downloaded and built a project on my PC, and it is on old java version 1.8, so when project building it will ask me to change the java version, and I have accepted that.
Here is the Solution,
As you see my project need a java 11 version to build Gradle so,
- GoTo File -> Settings
- Build,Execution and Deployment -> Build Tools -> Gradle
- Change java version, Apply and click Ok.
- Sync build.gradle and run the project.

Boken
4,4629 gold badges33 silver badges42 bronze badges
answered Mar 7, 2022 at 9:42
![]()
When building your Android application in Android studio, an error may occur saying Plugin with id ‘com.android.application’ was not found.
The error looks as follows:
* Exception is:
org.gradle.api.plugins.UnknownPluginException:
Plugin [id: 'com.android.application'] was not found
in any of the following sources:
The UnknownPluginException means that Gradle could not find the Android Gradle plugin required to build your application successfully.
To resolve this error, you need to check three things:
- Check that Google Maven repository is listed in your
settings.gradlefile - Check the Android Gradle plugin is added to the project
build.gradlefile - Check the Android Gradle plugin is compatible with your Gradle version
Let’s learn how to resolve this issue together.
Check your settings.gradle file
The Android Gradle plugin is downloaded from Google’s Maven repository. You need to make sure that the repository google() is listed under pluginManagement in your Android project.
The settings.gradle file is the file used to list repositories where Gradle will look to download dependencies for your Android project.
The content of the file should look as follows:
pluginManagement {
repositories {
gradlePluginPortal()
google()
mavenCentral()
}
}
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
}
}
rootProject.name = "KotlinApp"
include ':app'
If you only see the following line in settings.gradle:
Then it means your Android project was created a long time ago.
The repositories for your Android project should be located in build.gradle file instead. Let’s go there next.
Check your build.gradle file
An Android application project has two build.gradle files:
<project>/app/build.gradleis specific configuration for theappmodule<project>/build.gradleis the global configuration for your current Android project
The <project>/build.gradle file should contain the dependency to the Android Gradle plugin and its version as shown below:
plugins {
id 'com.android.application' version '7.1.2' apply false
id 'com.android.library' version '7.1.2' apply false
id 'org.jetbrains.kotlin.android' version '1.6.21' apply false
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Make sure that your build.gradle file is similar to the one shown above.
For older Android application projects, the build.gradle file will also contain the repository list as shown below:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
If you have similar content to the one above, then you need to replace jcenter() with mavenCentral() and google().
This is because JCenter repository has become read-only since March 31st, 2021. You can still download modules from the repo, but there will be no new version release there.
Additionally, you need to update your Android Gradle dependency to the latest version as shown below:
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.2'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Now your Android Gradle Plugin version and the repository list is up to date.
The last thing to check is the Gradle version used by your Android project.
Check your Gradle version
Every Android project generated using Android Studio contains a gradle-wrapper.properties file.
The file is located inside gradle/wrapper/ folder, and it defines the Gradle version used by your project.
Here’s an example of the gradle-wrapper.properties file content:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
distributionUrl=https://services.gradle.org/distributions/gradle-7.2-bin.zip
The distributionUrl property highlighted above shows the version of Gradle used by your Android project.
gradle-7.2-bin.zip means the project is using Gradle version 7.2.
You need to use the Gradle version that supports your Android Gradle plugin version
Here’s the compatibility list between Gradle and Android Gradle:
Updating Gradle table
As you have updated Android Gradle to version 7.1.2 before, you should use Gradle version 7.2+ as stated in the table.
To update your Gradle version, just change the version in the .zip file name:
gradle-7.0-bin.zip
gradle-7.2-bin.zip
gradle-7.3-bin.zip
Keep in mind that you also need to check the Android Studio version, because older Android Studio doesn’t support the latest Android Gradle plugin (link).
Once the Gradle version is updated, build your Android application again. The issue with com.android.application should now be resolved.
Conclusion
Now you’ve learned how to resolve the issue com.android.application not found in Android Studio.
As Android OS gets new releases and adds new features, older versions of Gradle and Android Gradle will become obsolete.
When you import a project into Android Studio, the first build should warn you of any incompatibility in the Gradle build process.
Sometimes, you need to update Gradle and Android Gradle versions before you can build the project successfully.
In some cases, you might see an Android project with missing Gradle files. To fix it, you can try creating a new project with Android Studio.
When the new project builds successfully, copy the Gradle files and gradle/ folder to your old Android project:
After that, change the rootProject.name attribute in your settings.gradle file to match the old project.
I hope this tutorial has been useful for you. 🙏
🐛 Bug Report
Hey I am just starting with React-Native I used the command react-native init MyProject, immediately after in the project folder I run react-native run-android and it throws the following error
* What went wrong:
A problem occurred evaluating project ':app'.
> Failed to apply plugin [id 'com.android.application']
> Cannot create directory /Users/davidneios/.android/build-cache/3.4.0
* 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.
I truly don’t know what to do, these are some of the files that seem to be important
gradle-wrapper.properties
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-5.4-all.zip
TopLevel: build.gradle
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
Error happens in file MyProject/android/app/build.gradle
To Reproduce
react-native init MyProjectreact-native run-android
Expected Behavior
This is the first time I am trying to run this command, I believe it should open the adroid studio emulator and show me something
Environment
info
React Native Environment Info:
System:
OS: macOS 10.14.3
CPU: (8) x64 Intel(R) Core(TM) i5-8259U CPU @ 2.30GHz
Memory: 357.97 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 11.10.0 - /usr/local/bin/node
Yarn: 1.13.0 - /usr/local/bin/yarn
npm: 6.8.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.4 AI-183.5429.30.34.5452501
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: 16.8.3 => 16.8.3
react-native: 0.59.5 => 0.59.5
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1
Last updated February 5, 2022 at 07:21 AM
This troubleshooting resolves the error Failed to apply plugin [id ‘com.android.internal.application’] in android studio.
We encountered a compilation error after a big update to the gradle tool. In this tutorial dedicated to troubleshooting computer errors we will try to provide the solution that worked (for us anyway) !!
Troubleshooting — Failed to apply plugin id ‘com.android.internal.application’- Android studio Click to tweet
Problem
While compiling your android application you find the error below:
A problem occurred evaluating project ': app'. > Failed to apply plugin [id 'com.android.internal.application']> The option 'android.enableUnitTestBinaryResources' is deprecated. The current default is 'false'. It has been removed from the current version of the Android Gradle plugin. The raw resource for unit test functionality is removed.
If this is your case, the help would be much simpler than it seems.
Solution
To solve this problem just remove the script line below from the file gradle.properties
android.enableUnitTestBinaryResources = true
The file gradle.properties is at the root of your project. It is difficult to miss it.
_When importing downloaded AS projects, we often encounter «Plugin with id’com.android.application’not found». This happens because the project lacks a build.grade. Com. android. application comes from com.android.tools.build:gradle:2.3.0 (version may be different). And com.android.tools.build:gradle:2.3.0 is defined in build.grade (Project **).

_. General gradle files are divided into two parts: project and module. Android’s engineering structure is project-based and can add multiple modules.
build.grade(Project**)
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
build.grade(Module**)
apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.0" defaultConfig { applicationId "locating.indoor.autonavi.com.onlinelocationdemo" minSdkVersion 18 targetSdkVersion 23 versionCode 1 versionName "1.0" ndk { abiFilter "armeabi" } } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } sourceSets { main { jniLibs.srcDirs = ['libs'] } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:23.0.0' }
In this case, copy the code in build.grade(Project **) to build.grade(Module **) and TryAgain. Be careful not to forget to change your AS version.
Issue
I have tried all the possible solutions for this error. Require guidance here:
I am using Windows Laptop : Android Studio 2020.3.1.22
Below is the build.graddle file:
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.example.myapplication3"
minSdk 21
targetSdk 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
// Flag to enable support for the new language APIs
coreLibraryDesugaringEnabled = true
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:1.1.5")
}
also my graddle wrapper properties:
distributionBase=GRADLE_USER_HOME
distributionUrl=https://services.gradle.org/distributions/gradle-7.0.2-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
my output of ./gradlew —version
Gradle 7.0.2
------------------------------------------------------------
Build time: 2021-05-14 12:02:31 UTC
Revision: 1ef1b260d39daacbf9357f9d8594a8a743e2152e
Kotlin: 1.4.31
Groovy: 3.0.7
Ant: Apache Ant(TM) version 1.10.9 compiled on September 27 2020
JVM: 1.8.0_275 (Azul Systems, Inc. 25.275-b01)
Android Sdk version: C:UsersUser nameAppDataLocalAndroidSdk
Gradle JDK: 11 version 11.0.12 C:Program FilesJavajdk-11.0.12
Java Version:
C:UsersVainav ShahStudioProjectsMyApplication3>java --version
java 16.0.2 2021-07-20
Java(TM) SE Runtime Environment (build 16.0.2+7-67)
Java HotSpot(TM) 64-Bit Server VM (build 16.0.2+7-67, mixed mode, sharing)
Please guide to resolve this error:
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.
— changingorg.gradle.java.homeingradle.properties.
Solution
Well I also face same issue

What worked for me is this (In Windows 10 OS based Laptop)
Go to File—>Settings—>Build,Execution,Deployment—>Build Tools—>Gradle
Now here —>Gradle JDK change 1.8 to 11(given in dropdown).
See image given to get more clear idea.

After that just REBUILD YOU PROJECT. It worked for me. (see attached image).

SO ERROR IS SOLVED AND EVERY THING IS FINE IN PROJECT NOW.
HOPE THIS WORKS FOR YOU TOO! THANKS.
Answered By — SaiAbhijit