Nijil Nair
Nijil Nair

Reputation: 1608

Phonegap(cordova 3.5) Android Build failed

I am working on cordova 3.5 project in Mac. I have created and build using CLI. But Android build failed. I have set sdk path. Below is the error I am getting. I have not added any plugin.

cordova build android

Generating config.xml from defaults for platform "android"
Preparing android project
Compiling app on platform "android" via command "/Users/user/Documents/Phonegap_Projects/Test1/platforms/android/cordova/build" 
Error: An error occurred while building the android project.Error executing "ant debug -f "/Users/user/Documents/Phonegap_Projects/Test1/platforms/android/build.xml"": 
BUILD FAILED
/Users/user/Documents/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:601: The following error occurred while executing this line:
/Users/user/Documents/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Users/user/Documents/adt-bundle-mac-x86_64-20140702/sdk/tools/ant/build.xml:734: Class not found: javac1.8

Total time: 2 seconds


at ChildProcess.<anonymous> (/usr/local/lib/node_modules/cordova/src/compile.js:65:22)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:756:16)
at Socket.<anonymous> (child_process.js:969:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)

Upvotes: 0

Views: 1277

Answers (1)

kindasimple
kindasimple

Reputation: 2427

Looks like the java compiler is not in your PATH. Take a look at the PhoneGap Android Platform Guide.

You may also need to enable Java and Ant. Open a command prompt and type java, and also type ant. Append to the PATH whichever of these fails to run:

;%JAVA_HOME%\bin;%ANT_HOME%\bin

You can test your configuration by running javac at a command prompt.

Upvotes: 1

Related Questions