(gradle-2.13-all)-Exception in thread "main" java.lang.RuntimeException: java.io.IOException: Server returned HTTP response code: 403 for URL: http://services.gradle.org/distributions/gradle-2.13-all.zip

 Answer:

There are some simple steps to fix the error.

1) find and open platforms\android\cordova\lib\builders\GradleBuilder.js file with text editor.
Find the line

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

then change http to https in this line as follows:

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

then save the file.

2) Check installed jdk versions and install jdk 1.8 if not installed.

Then if the JAVA_HOME environment variable is anything but 1.8 open tools->options->Tools for Apache Cordova->Environment Variable Overrides in Visual Studio, check the JAVA_HOME checkbox and select the java 1.8 folder like follows:

C:\Program Files\Java\jdk1.8.0_241

then run build it will work.

Comments

Popular posts from this blog

LetsLearn JavaScript

Cordova App for Publishing to an App Store - Steps by Steps (https://docs.microsoft.com/)