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
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’;
with your method you need to change each time you do a cordova add plaftorm android or simply reload your project from your repository.
with environment variable you only need to update the variable when you update your gradle (for example when Android Studio ask you to update it). And can be use for all the project.