Ionic change gradle version doesn't work

image

I got this error when running ‘ionic run android’

What I did is change this line to

distributionUrl=http://services.gradle.org/distributions/gradle-2.10-all.zip

as the terminal suggested. But it still has the error, and the file got reverted to distributionUrl=http://services.gradle.org/distributions/gradle-2.2.1-all.zip

still. Any thought?

you have to modify ./platforms/android/cordova/lib/builders/GradleBuilder.js
at this line:

var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'http\\://services.gradle.org/distributions/gradle-2.14-all.zip';

and:

build.gradle at this line:

dependencies {
    classpath 'com.android.tools.build:gradle:2.1.0'
}
7 Likes

Which version of cordova platform do you use?

For me ./platforms/android/cordova/lib/ is empty and I am using cordova android 5.2.2 and ionic 2.0.1