Gaurav Sharma
Gaurav Sharma

Reputation: 15

cordova build android command error

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.

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"

Upvotes: 0

Views: 784

Answers (2)

Navin a.s
Navin a.s

Reputation: 416

  • 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

Upvotes: 0

Ajay Kulkarni
Ajay Kulkarni

Reputation: 3039

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.

Upvotes: 0

Related Questions