0

while building cordova project i get the follwing error on running command cordova build android?
please help with the follwoing code

 C:\Users\gaurav-s\hello>cordova build android

ANDROID_HOME=D:\adt-bundle-windows-x86-20140702\sdk JAVA_HOME=C:\Program Files\Java\jdk1.7.0

FAILURE: Build failed with an exception.

  • What went wrong: A problem occurred configuring root project 'android'.

    Could not resolve all dependencies for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:1.5.0. Required by: :android:unspecified Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradl e/1.5.0/gradle-1.5.0.pom'. Received status code 407 from server: Proxy Authentic ation Required

  • Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 10.001 secs Error: Error code 1 for command: cmd with args: /s,/c,"C:\Users\gaurav-s\hello\p latforms\android\gradlew cdvBuildDebug -b C:\Users\gaurav-s\hello\platforms\andr oid\build.gradle -Dorg.gradle.daemon=true -Pandroid.useDeprecatedNdk=true"

  • are you under a proxy? If you are, check this out to set your proxy http://stackoverflow.com/questions/30219065/gradle-cant-connect-to-maven-repo-through-corporate-proxy-need-to-configure-t – dariru Jun 29 '16 at 04:55
  • after i changed the setting i am getting the following error "Could not GET 'https://jcenter.bintray.com/com/android/tools/build/gradl e/1.5.0/gradle-1.5.0.pom'. Received status code 407 from server: Proxy Authentic ation Required" – Gaurav Sharma Jun 29 '16 at 05:51
  • can you edit your question and copy paste the next entire error that comes out? Maybe this is also something similar: http://stackoverflow.com/questions/5991194/gradle-proxy-configuration – dariru Jun 29 '16 at 05:59
  • updated the new error. – Gaurav Sharma Jun 30 '16 at 05:09
  • This happened to me before. It might be a certification problem. Ignore the part about eclipse, but just import the certificate. http://stackoverflow.com/questions/22887829/peer-not-authenticated-while-importing-gradle-project-in-eclipse – dariru Jun 30 '16 at 05:52
  • still the error remains same. :( – Gaurav Sharma Jul 01 '16 at 04:47

2 Answers2

0

Build tools have been moved from maven to jcenter. Go to your gradle settings file. Change

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
}

to

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:1.5.0'
    }
}  

It is better to update your gradle to latest version.

Ajay Kulkarni
  • 2,900
  • 13
  • 48
  • 97
0
  • This is because of gradle error Download the file
  • http://services.gradle.org/distributions/gradle-2.14.1-all.zip

  • and extract it in any of directory and set the path by open cmd and enter

  • setx path (extracted direstory)/bin

  • after reopen cmd and check whether the gradle is works or not by give

  • gradle -v

  • it shows the gradle version output .

  • Now the error is fixed run

  • ionic build android

Navin a.s
  • 416
  • 2
  • 8
  • 19