Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap Getting Started with Android "Missing one of the following"

I am currently following this tutorial about getting started on PhoneGap. I have installed everything and set the path on system variable.

But when I am going to build the project it always give an error of

Missing one of the following: JDK Android SDK Apache ant

I have check with command, java, adb, ant, inside the command prompt. java and adb seems work perfectly, but ant return an error "Build.xml does not exist. build failed".

How can I generate the project file?

like image 367
n0talentGEEK Avatar asked Nov 19 '12 11:11

n0talentGEEK


4 Answers

You may want to check out my supplemental to the getting started guide:

http://simonmacdonald.blogspot.ca/2012/11/getting-create-command-to-work-on.html

You will need to make sure you can execute javac as well and that your JAVA_HOME is set correctly.

Don't worry about the ant error. As long as it is found from the command line it will work properly when launched from a directory with a build.xml.

like image 148
Simon MacDonald Avatar answered Nov 15 '22 21:11

Simon MacDonald


For me the problem was the variables for ANT_HOME and JAVA_HOME. I found different descriptions on how they should look (eg. %JAVA_HOME%\bin). It dident work for me check the pics out for how to set the variables correctly. Also put the reference to C:\Java\jdk1.6.0_31\bin and C:\Java\apache-ant-1.8.4\bin on your path variable.

how java home should look like

How ant home should look like

Take note that you may have installed jdk and ant in different directories than i did, but the above is how they should look.

like image 42
Hersker Avatar answered Nov 15 '22 22:11

Hersker


Ensure that you don't use a dash ("-") or a space in the directory that you are creating your project. As well, I would ensure that you have the ANT_HOME variable pointing to the correct directory. Simon's blog points this out, but you can get slightly more info (on this particular thing) from my post here: installing Cordova\PhoneGap .

I use the ant directory found in eclipse\plugins\org.apache.ant... Perhaps your ant directory in the sys variables is to a different ant installation? Not sure if that would be a problem.

like image 21
dardawk Avatar answered Nov 15 '22 22:11

dardawk


In addition to what has been said, I had two more problems :

1) The spaces in the paths were causing trouble : I replaced the Program Files folder this way :

Program Files = Progra~1

Program Files (x86) = Progra~2

2) cscript.exe was not recognized so I added the System32 folder to the PATH.

like image 32
Emanuel Avatar answered Nov 15 '22 21:11

Emanuel