2

I created a Cordova 5.1.1 project using Visual Studio 2015. I am behind an ntlm proxy. I added the proxy settings anywhere I could find (Gradle, Java console, Crodova CLI, etc.) and use Cntlm for NPM but I still can't get the build to work. Pre-Cordova 5 I had several builds working with Ant.

The build fails with the following error:

  FAILURE: Build failed with an exception.
1>
1>  * What went wrong:
1>  A problem occurred configuring root project 'android'.
1>  > Could not resolve all dependencies for configuration ':classpath'.
1>     > Could not resolve com.android.tools.build:gradle:1.0.0+.
1>       Required by:
1>           :android:unspecified
1>        > Failed to list versions for com.android.tools.build:gradle.
1>           > Unable to load Maven meta-data from https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml.
1>              > Could not GET 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/maven-metadata.xml'.
1>                 > peer not authenticated
1>
1>  * Try:
1>  Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
1>
1>  BUILD FAILED
1>
1>  Total time: 2.389 secs
1>
1>  platforms\android\cordova\node_modules\q\q.js:126
1>                      throw e;
1>                            ^
1>  Error code 1 for command: cmd with args: /s /c ""platforms\android\gradlew" cdvBuildDebug -b "platforms\android\build.gradle" -Dorg.gradle.daemon=true"
1>  Command finished with error code 1: cmd /s /c ""platforms\android\cordova\build.bat" --debug "--buildConfig=\build.json""
1>ERROR building one of the platforms : error : cmd: Command failed with exit code 1
1>  You may not have the required environment or OS to build this project
1>MDAVSCLI : error : cmd: Command failed with exit code 1
1>
1>Build FAILED.

Note: I have removed the full paths, but they are there in the original build output.

I noticed that the Maven repo certificate is not currently valid, but I have no idea if this is relevant or just some issue with our proxy not passing certificates.

Elad Lachmi
  • 10,406
  • 13
  • 71
  • 133

1 Answers1

0

Just do exactly what's suggested here: http://www.scriptscoop.com/t/82d4495f9d81/android-gradle-cant-connect-to-maven-repo-through-corporate-proxy-need-to-conf.html

Don't forget that you should set a regular http and also https proxy.

This worked for me with exactly the same error you're experiencing.

Lentyai
  • 968
  • 1
  • 10
  • 25
  • 1
    It's a shame you didn't copy and paste what was written. I cannot get to the that website. – Onosa Feb 18 '16 at 22:16
  • It was a reference so I could not count on fact that it will not be available one day. Check this solution, as I remember, it was the solution for me: [gradle.properties](http://stackoverflow.com/a/34178564/2471497). – Lentyai Feb 23 '16 at 09:37