PhoneGap Getting Started with Android "Missing one of the following"
Asked Answered
D

4

13

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?

Dasie answered 19/11, 2012 at 11:4 Comment(0)
J
29

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.

Jasik answered 19/11, 2012 at 15:21 Comment(6)
Hello there. I have test all things mentioned there on command prompt: javac, ant, adb, android. And sadly there is nothing wrong with all of those (except for ant build.xml) I still get same error when trying to generate new android project. :(Dasie
Yes I am sorry I have fixed it so what I do is I set JAVA_HOME.Dasie
This should be in the Cordova documentation.Limitary
Yes, I pushed some updates to the docs and will make sure the docs and 2.3.0 create script works better on windows.Jasik
I've just downloaded the cordova 2.5.0 package. I've got the same error and can't get rid of it. I've checked everything explained in your blog post but still don't know what happens.Emancipation
First of all thanks for sharing this info. It's clearly wrong for the docs to assume we're all using macs. Now the thing is I've all environment variables properly setted, and still doesn't work. I'm giving up and I'll just try to get a project setup from the template project.Bedtime
I
12

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.

Incoherence answered 21/12, 2012 at 8:56 Comment(0)
C
3

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.

Cypher answered 4/12, 2012 at 6:9 Comment(0)
A
2

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.

Aphorism answered 11/1, 2013 at 9:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.