Skip to content Skip to sidebar Skip to footer

Phonegap 3.0 Android Build Command Failed To Execute : Ant Jar

I installed PhoneGap 3.0 with Node.js and configured all the environment variables so that javac, java, and ant all work but when I do a basic app create and try to build it for An

Solution 1:

Make sure you have the Android Build Tools installed for your Android SDK version. In the Android SDK manager under Tools>Android SDK Build-tools you should see that the Build tools for your SDK version are not installed.

Detail on how I uncovered this:


To identify this as the root cause I ran the Cordova command with -d for verbosity:

cordova -d platform add android

The output of this command shows the error:

Running bin/create for platform "android"with command: ""C:\Users\---\.cordova\lib\android\cordova\3.1.0\bin\create"  "C:\Users\---\workspace_android\FleetView\platforms\android" "com.---.fleetview" "Fleet View"" (output to follow)

Running the offending command directly:

"C:\Users\---\.cordova\lib\android\cordova\3.1.0\bin\create""C:\Users\---\workspace_android\FleetView\platforms\android""com.---.fleetview""Fleet View"

produces this output:

BUILD FAILED
C:\tools\adt-bundle-windows-x86_64-20130219\sdk\tools\ant\build.xml:479: SDK does not have any Build Tools installed.

Total time: 1second
Command failed toexecute : ant jar

I am on Windows 7.

Solution 2:

This is due to ANT tools could not find tools.jar in JRE lib directory. When I copied tools.jar from JDK lib directory to JRE lib directory, the problem was absolutely solved and the build was successful when I ran the command "cordova -d platform add android". Hope this helps you.

Posted the answer to similar question: Android Platform Guide trouble with adding a platform through the command line

Solution 3:

A combination of 2 things worked for me:

  • include the JDK in your path (path\to\jdk\bin of course)
  • exclude the JRE from your path (or at least have it come after the JDK)

Solution 4:

I faced the same issue, I was having jdk-6 and I updated to jdk-7, that fixed the issue, Also I didn't installed ant in the first place, in your case ant PATH might be missing. See if that helps.

Post a Comment for "Phonegap 3.0 Android Build Command Failed To Execute : Ant Jar"