android – Gradle can't connect to maven repo through corporate proxy – need to configure through Sencha/Cordova-ThrowExceptions

Exception or error:

I’m trying to build a Sencha Touch app for android using Cordova. However, after the gradle build kicks off I get a connection error when trying to connect to the maven repo:

[INF] [shellscript] Running: C:\xxx\gradlew cdvBuildDebug -b C:\xxx\application\cordova\platforms\android\build.gradle -Dorg.gradle.daemon=true
[INF] [shellscript]
[INF] [shellscript] FAILURE: Build failed with an exception.
[INF] [shellscript]
[INF] [shellscript] * What went wrong:
[INF] [shellscript] A problem occurred configuring root project '''android'''.
[INF] [shellscript] > Could not resolve all dependencies for configuration ''':classpath'''.
[INF] [shellscript]    > Could not resolve
[INF] [shellscript]      Required by:
[INF] [shellscript]          :android:unspecified
[INF] [shellscript]       > Failed to list versions for
[INF] [shellscript]          > Unable to load Maven meta-data from https://repo1
[INF] [shellscript]             > Could not GET '''
[INF] [shellscript]                > Connection to refused

I would imagine this is related to the corporate proxy I have to connect through in my office – however I’m not sure how to configure Gradle to connect via this proxy since it is being executed by Cordova, which is itself being executed by Sencha Cmd.

Is there a way to configure a proxy with Sencha?

How to solve:

You’ll need to configure Gradlew to use a proxy server. This is done by creating a file with the following contents:

This is an example taken from Chapter 19.3 of the User Guide. Make sure you include both the HTTP and HTTPS values in your file.

You’ll place this file in either of these locations:

  1. In your “cordova/platform/android” folder for your mobile project


  1. In your Gradle home folder. For Windows, this is likely %USERPROFILE%\.gradle\ (Ex: C:\Users\username\.gradle\).

I would recommend putting it in Gradle home so that other projects pick it up and you don’t have to worry about putting it under source control.

You can also find more info in this post.


I had the same error, but it was after i installed git which in turn changed my environment variables. I went back there to remove the added path and it worked

Leave a Reply

Your email address will not be published. Required fields are marked *