Minimum supported Gradle version is 4.1. Current version is 4.1-rc-1


#1

How can I solve this error
Minimum supported Gradle version is 4.1. Current version is 4.1-rc-1

Detailed msg:

  • What went wrong:
    A problem occurred evaluating root project ‘android’.

Failed to apply plugin [id ‘com.android.application’]
Minimum supported Gradle version is 4.1. Current version is 4.1-rc-1. If using the gradle wrapper, try editing the distributionUrl in /xx/gradle-wrapper.properties to gradle-4.1-all.zip

thank you


#2

Edited my GradleBuilder.js in some location like this
$PROJECT_ROOT/platforms/android/cordova/lib/builders/GradleBuilder.js

my original line
var distributionUrl = process.env[‘CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL’] || ‘http\://services.gradle.org/distributions/gradle-2.2.1-all.zip’;
var distributionUrl = ‘https\://services.gradle.org/distributions/gradle-4.1-rc-1-all.zip’;

changed to gradle-4.2-all.zip and worked !

reference more details -> https://stackoverflow.com/questions/37125496/cordova-build-changes-distributionurl-in-gradle-wrapper-properties-file