Minimum supported Gradle version is 6.1.1. Current version is 5.6.4
GradleAndroid Studio-4.0Gradle Problem Overview
I'm facing this issue after updating to android studio 4.0 while Having older gradle version:
After that I have download the latest gradle version 6.4.1, after the complete download it give error of
Unable to find method
'org.gradle.api.tasks.TaskInputs.property(Ljava/lang/String;Ljava/lang/Object;)Lorg/gradle/api/tasks/TaskInputs;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.
Here is an image of error:
I already tried with invalid caches/Restart , Clean Project and rebuild project and also deleted the cache folder but still facing the same issue, now I can't use lower gradel.
Gradle Solutions
Solution 1 - Gradle
I faced this error. so I added the line below to build.gradle(project)
file ,dependency
part:
classpath 'com.android.tools.build:gradle:3.6.0'
and I changed distributionUrl
in gradle-wrapper.properties
file to :
https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
It solved my problem I hope solve yours too.
Update 09/21/2020
Finally, I upgrade all of my plugins and libraries and It works perfectly by gradle-6.6.1-all.zip
in gradle-wrapper.properties
file and classpath 'com.android.tools.build:gradle:4.0.1'
in Gradle project in dependencies
section.
Be careful if you use greenDAO
or sqlcipher
to upgrade correctly
Solution 2 - Gradle
Android studio recommended for gradle upgrade and I got similar error. I quickly found string "5.6.4" using ctrl+shift+f. I got 2 files refering to gradle version 5.6.4 and updated both of them to 6.1.1 and it worked for me.
Solution 3 - Gradle
Try editing the distributionUrl
in ..\android\gradle\wrapper\gradle-wrapper.properties
to gradle-6.5-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5-all.zip
Solution 4 - Gradle
For me, it seemed that I had upgraded the plugin version to "classpath 'com.android.tools.build:gradle:4.1.2'" but I could not get Android Studio to update to gradle 6.5 from 6.1.1 for some reason.
Eventually I downgraded the plugin to "classpath 'com.android.tools.build:gradle:4.0.0'", according to https://developer.android.com/studio/releases/gradle-plugin.
Then the IDE offered me a quickfix upgrade back to 4.1.2 and also 6.5, and after that it started working again.
Solution 5 - Gradle
I faced this issue just now. And I found the solution.
1) find gradle/wrapper/gradle-wrapper.properties
file (not in .gradle
folder it is in gradle
folder). If your project not have gradle-wrapper.properties
file, just create it in that location.
Add these lines to your gradle-wrapper.properties
file.
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
Remember!
You need to change distributionUrl the current version of gradle version in your Android Studio (in this case it is gradle-5.6.4-all.zip)
Solution 6 - Gradle
Gradle version in either the File > Project Structure > Project menu in Android Studio, or by editing the Gradle distribution reference in the gradle/wrapper/gradle-wrapper.properties file. The following example sets the Gradle version to 6.7.1 in the gradle-wrapper.properties file.
Look for the correct version from below: https://developer.android.com/studio/releases/gradle-plugin
Solution 7 - Gradle
add this line in gradle-wrapper.properties
distributionUrl=https://services.gradle.org/distributions/gradle-6.1.1-bin.zip it worked for me
Solution 8 - Gradle
Upgrade Gradle version
Failed to apply plugin [id 'com.android.internal.version-check']
> Minimum supported Gradle version is 6.7.1. Current version is 6.1.1. If using the gradle wrapper, try editing the distributionUrl in G:\Home\androidproject\pactices\appsghor\exoplayer\gradle\wrapper\gradle-wrapper.properties to gradle-6.7.1-all.zip
in wrapper.properties
distributionUrl = https\://services.gradle.org/distributions/gradle-6.7.1-all.zip
Solution 9 - Gradle
For my case, I could not find the Gradle folder from the project which I am trying to syn with gradle, so I copy the whole Gradle folder(You can just create a new Android project and copy from it. for people who could not find gradle-wrapper.properties
, it's there.) to the project you have problems with Gradle syn, and it works in my case.
Solution 10 - Gradle
ALTERNATIVE WAY: Open https://gradle.org/next-steps/?version=6.6.1&format=all to download latest gradle. Now you need to extract it to some location in your PC. Now in android studio press ctrl+alt+s to open settings. Navigate to Gradle and provide path to exttracted folder. Also modify as use gradle from to use specified location(provide extracted path even here). (ViewImage) Click apply and restart android studio.
Solution 11 - Gradle
For me, this required a multi-stage fix combining several of the above. I had pulled a project that didn't include a gradle directory, so none of the other answers apply.
To create the gradle directory I first edited the build.gradle and downgraded the classpath to match the version from https://developer.android.com/studio/releases/gradle-plugin In the original question, the error shows that the current version is 5.6.4, so that table indicates we should downgrade the build tools to 3.6.0.
classpath 'com.android.tools.build:gradle:3.6.0'
Then I did a sync project with gradle files and built the project. That succeeded since my downloaded gradle matched the requested version. This created the gradle directory, including the gradle-wrapper.properties file.
Then I edited the gradle-wrapper.properties as described in the other replies to update to 6.1.1
distributionUrl = https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
I did another sync project with gradle files and build. Everything worked, so I then updated my build.gradle to restore the original value
classpath 'com.android.tools.build:gradle:4.0.0'
Then I did a third sync project with gradle files and build. Now my project is exactly where it should be with no errors.
Solution 12 - Gradle
I also faced this problems many times but I resolved it by changing gradle version from distributionUrl in gradle-wrapper.properties
file to
https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
or Later. Hope that by adding this, error will resolve
Solution 13 - Gradle
In Flutter
To fix it upgrade your Gradle
When you update Android Studio, you may receive a prompt to also update Gradle to the latest available version. You can choose to accept the update or manually specify a version based on your project's build requirements.
Update Gradle version in the YourAppDirectory/android/gradle/wrapper/gradle-wrapper.properties file. sets the Gradle version to 6.1.1 in the gradle-wrapper.properties file.
...
distributionUrl = https\://services.gradle.org/distributions/gradle-6.1.1-all.zip
...
The following table lists which version of Gradle is required for each version of the Android Gradle plugin. For the best performance, you should use the latest possible version of both Gradle and the plugin.
For more, see: https://stackoverflow.com/a/65857921/10563627
Solution 14 - Gradle
Go to gradle->wrapper->gradle-wrapper.properties then change the version in the distribution url to whatever the error message says is minimum requirement