Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap Setup Cordova Error Create Error

I am trying to get set up on a basic Hello World phonegap android application. I have installed and correctly configured the paths for ant, the java jdk, and the android sdk. However, when I attempt to run

create C:\Users\Shoes\Documents\Dev\Test com.codebundle.test Test

and cordova gave me the following error

Missing one of the following:
JDK: http://java.oracle.com
Android SDK: http://developer.android.com
Apache ant: http://ant.apache.org

I have tested that all the paths are setup correctly by trying

ant
adb
java

All worked fine, Please help

like image 547
Code Bundle Avatar asked Nov 12 '12 11:11

Code Bundle


2 Answers

To add the paths to the PATH variable isn't enough. You need to add JAVA_HOME explicit with the path to the bin folder of the JDK, for example:

 JAVA_HOME -> C:\Program Files\Java\bin

Phonegap/Cordova is looking for the JAVA_HOME variable in your settings.

like image 39
emcoding Avatar answered Oct 05 '22 02:10

emcoding


If you type "android" what happens? You need to make sure that the $ANDROID_HOME/tools and $ANDROID_HOME/platform-tools are both in your $PATH.

http://docs.phonegap.com/en/2.2.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android

Worked with a friend last night and his problem was the JRE was in his path and not the JDK. So when he typed javac it could not be found. If you have the same issue you'll need to update your PATH to point to the location of the JDK.

like image 163
Simon MacDonald Avatar answered Oct 05 '22 01:10

Simon MacDonald