Ionic build Android error when downloading Gradle

Since the solution posted above needs to include .zip into folder that is about 55MB

You can also force CLI to use Ant instead of gradle during a build with the following command:

cordova build android -- --ant

I am using Ionic version 1.7.14 and the distributionUrl found in the following file. myApp/platforms/android/cordova/lib/builders/GradleBuilder.js.

I had to point the locally downloaded gradle as specified in this answer.

I had the same problem. I added gradle to my project offline.

After downloading gradle from issued link (here is http://services.gradle.org/distributions/gradle-2.2.1-all.zip) paste it in somewhere likes myApp\platforms\android\gradle\gradle-2.2.1-all.zip and in build.js from myApp\platforms\android\cordova\lib\build.js find this:

var distributionUrl = 'distributionUrl=http\\://services.gradle.org/distributions/gradle-2.2.1-all.zip';

And replace it with your own file's location:

var distributionUrl = 'distributionUrl=../gradle-2.2.1-all.zip';