In this Android Tutorial, we shall see how to fix Android Gradle Error Minimum supported Gradle version is 4.0-rc-1. Current version is 4.0-milestone-1.
The process should be same, despite the current and minimum supported versions mentioned in the Gradle Error.
gradle-wrapper.properties under Gradle Scripts is the file that has to be modified.
As the error says that Current version is 4.0-milestone-1, this is the version that is present in the gradle-wrapper.properties file. The contents of the file would be as shown in the following.
gradle-wrapper.properties
#Mon Jun 26 14:52:01 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-milestone-1-all.zip
To fix the error, change the Gradle version in the field distributionUrl to gradle-4.0-rc-1, as shown in the following.
gradle-wrapper.properties
#Mon Jun 26 14:55:17 IST 2017
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.0-rc-1-all.zip
This should fix the Gradle Error and now try again with the Gradle Sync. In this tutorial, we have learnt how to fix the Android Gradle error.