no such file - ant jar - Install Phonegap problem

168 views
Skip to first unread message

jingle

unread,
Aug 20, 2010, 3:24:53 PM8/20/10
to phonegap
Hi there I'm receiving the following error when trying to run

ruby .droidgap "E:/apps/android-sdk-windows" new com.niceone.demo "E:/
app" "E:/nice"


It comes up with No such file or directory - ant jar

As far as I know I have set the ANT_HOME JAVA_HOME ANDROID_HOME etc.

Anyone know how to solve?

Nick McCloud

unread,
Aug 21, 2010, 7:25:09 AM8/21/10
to phonegap
I'm just in the process of setting up on Windows (got Mac working a
treat). Noticed this at the bottom of the how-to:

"For windows users: either use cygwin or git bash to execute above
commands. If these options aren't available then try changing the
droidgap script and change all calls to the command 'ant' to
'ant.bat', and same thing for the android command calls ('android' to
'android.bat') "

Translation: If you aren't using a 'nix type machine, you have to
emulate it OR change stuff to point to Windows versions.

I'll let you know how I get on!

Nick McCloud

unread,
Aug 21, 2010, 9:23:57 AM8/21/10
to phonegap
OK, some head scratching later.

First, in droidgap, I had to change the reference to ant to ant.bat
and the ref. to android to android.bat as per the comment above.

Next, I had to download Android SDK's 1.6 and above as the build kept
winging about not finding various Android configs.

And it works right up to running it in the emulator.

Nick

jingle

unread,
Aug 22, 2010, 5:02:56 AM8/22/10
to phonegap
Hi Nick,

I'm not quite sure where to change the android to android.bat as there
are several mentions of android in the droidgap script. I've tried
replacing it in a couple of places but no luck. Any chance of a little
help on this? been real hair pulling stuff for me!

Best
David

ericburnley

unread,
Aug 22, 2010, 5:03:05 PM8/22/10
to phonegap
Hi guys. After just having spent about 20 hours this weekend to get a
PhoneGap install completely redone on Windows in order to push up a
prototype, I'm hoping I can be of help.

First off, this article was the best step-by-step instructions i've
seen:
http://dev.tonic1394.com/2010/06/phonegap-the-missing-androidwindows-setup-guide/

After all of this is followed to the letter, not much else is really
needed to be changed.
I would say make sure your Paths are set correctly, like:
- PATH includes your ruby, ApacheANT, Java, and Android_SDK install
points including the bin directories (/tools for the Android_SDK)
- make sure you add individual paths for APACHE_HOME, JAVA_HOME, and
ANDROID_HOME that point to the root install folders for each (one
directory up from the bin or tools folders)

Another stumbling point not mentioned is to make sure you have the
Android SDK install ALL of the available platforms of Android. Each
one that is installed adds a Target Id, which is the Target value
referenced in the actual droidgap file. If you add only frameworks
for 2.1 and 2.2, you will have Target Id 1 and Target Id 2, but
droidgap by default points to Target Id 5 in the 0.9.0.1 release and
Target Id 8 in the edge release currently. I think that can cause an
error like file or target not found. Once you have all the previous
incarnations of frameworks/sdks created, you should have more like 12+
Target Ids. To see how many you have, open a command line in the
Android_SDK/android-sdk-windows/tools folder and type "android.bat
list targets" at the command line and it should list them all out with
the associated Android OS.

So once you have all those installed, you pick the one you want to
build for (i used 2.1-update1, which was Target Id 9) and modify the
target setting in the droidgap file. No other modifications should be
needed in my experience (no android -> android.bat or similar
changes).

Once that droidgap change is made, you should be able to run git bash
on the droidgap file and do your ruby command. Also, I used no
quotation marks in my paths, just forward slashes in all of them- but
i had no spaces anywhere.

Post back how you're doing.

Nick McCloud

unread,
Aug 22, 2010, 5:11:26 PM8/22/10
to phonegap
Line37:
`ant.bat jar`

Line 49:
`android.bat create project -t #{ target_id } -k #{ @pkg } -a
#{ @name } -n #{ @name } -p #{ @path }`

'twas all I changed.

blicken...@googlemail.com

unread,
Aug 23, 2010, 5:30:20 AM8/23/10
to phonegap
hi

well, so you had more success then me...congrats! ;)

i followed the same instructions...all my path are set and working, as
well i'm using cygwin (so no .bat problem there). and is running ,
ruby too (i checked the script line by line echoing values to find out
where its going wrong).

but when "ant jar" is called, i instantly get some weird errors saying
"/* is not a command" (from windows cmd) and so on. which looks to my
like some batch-script is called and trying to rund comments as
commands?

anyone has seen this too ?

thanks a lot



On Aug 22, 11:03 pm, ericburnley <ericburn...@yahoo.com> wrote:
> Hi guys.  After just having spent about 20 hours this weekend to get a
> PhoneGap install completely redone on Windows in order to push up a
> prototype, I'm hoping I can be of help.
>
> First off, this article was the best step-by-step instructions i've
> seen:http://dev.tonic1394.com/2010/06/phonegap-the-missing-androidwindows-...

jingle

unread,
Aug 23, 2010, 5:40:03 PM8/23/10
to phonegap
OK i've made some progress and got past the ant jar problem.

it worked for me after I went to command prompt and typed in

set ANT_HOME=c:\ant
set JAVA_HOME=c:\jdk-1.5.0.05
set PATH=%PATH%;%ANT_HOME%\bin


Now I have a new problem. It now says No such file or directory -
android create project. HELP!!!!!!



On Aug 23, 10:30 am, "blickensdoer...@googlemail.com"

jingle

unread,
Aug 23, 2010, 5:45:53 PM8/23/10
to phonegap
just solved it. I had to do all the PATHS in command prompt. I'm on
windows 7 so maybe thats the issue.

I did:

SET ANT_HOME=E:\apache-1.8.1
SET JAVA_HOME=javajdk root address
SET ANDROID_HOME = E:\android-sdk-windows
SET PATH=%PATH%;%ANDROID_HOME%\tools
SET PATH=%PATH%;%ANT_HOME%\bin

Nick McCloud

unread,
Aug 23, 2010, 5:47:12 PM8/23/10
to phonegap
Have you set the ANDROID_HOME? You should set all these as environment
variables as per the instructions.

Have you changed the droidgap script to use android.bat (line 49), as
above.

Nick

Rukksi

unread,
Aug 23, 2010, 6:07:18 PM8/23/10
to phonegap
For windows I had to change ant to ant.bat and android to android.bat
in the droidgap file.
I then get taskdef class com.adndroid.ant.SetUpTask not found
To fix this I ran
ruby ./droidgap C:/AndroidSDK TestGap TestGap.com C:/www C:/phonegap/
projects/testgap
NOTE paths use single forward slash, Android SDK value doesn't include
tools directory - just specify the root.

jingle

unread,
Aug 23, 2010, 7:37:51 PM8/23/10
to phonegap
Hi nick

Yeah I had set the Android home in the environment variables, but for
some reason it wasn't until I set both Android and ant home paths in
command prompt that it worked. In the end I didn't have to change to
Android.bat and ant.bat, I tried it before but no luck so reverted
back.

Thanks for all your help everyone

Komal

unread,
Sep 2, 2010, 12:18:08 PM9/2/10
to phonegap
Hi Ericburn,
I have the same issue for the ant jar
I have all the paths sets appropriately..

I tried the above suggestions for changing the droidgap file for ant
to ant.bat and android to android.bat but it didnt work.

I am trying to use the git bash... now..

How do we run the git bash on the droidgap file?

I am not able to navigate to the phone gap folder..

Can you give some sample commands..?

Thanks,
Komal

Komal

unread,
Sep 3, 2010, 1:14:53 AM9/3/10
to phonegap
Hi,

After restarting my machine I seemed to out of the ant jar problem
but now I am facing this error

C:\Documents and Settings\Administrator\Desktop\phonegap-phonegap-
android-90b708
f>ruby ./droidgap "C:/Documents and Settings/Administrator/Desktop/
android-sdk_r
06-windows/android-sdk-windows" pepflirtwindows de.hotornot "C:/
Documents and Se
ttings/Administrator/Desktop/www" "C:/Documents and Settings/
Administrator/Deskt
op/pep"
Building the JAR...
Creating Android project for target level 3
./droidgap:49:in ``': No such file or directory - android.bat create
project -t
3 -k de.hotornot -a pepflirtwindows -n pepflirtwindows -p C:/Documents
and Setti
ngs/Administrator/Desktop/pep (Errno::ENOENT)
from ./droidgap:49:in `create_android'
from ./droidgap:17:in `run'
from ./droidgap:157

I have modified the droidgap file.. changed the ant to ant.bat and the
android to android.bat

please tell me where I am wrong.. try this from 2 days :(

thanks,
Komal

Simon MacDonald

unread,
Sep 3, 2010, 9:27:20 AM9/3/10
to phonegap
In that case, if you are doing this in Git Bash try the following modification to your command line:

ruby ./droidgap "/c/Documents and Settings/Administrator/Desktop/android-sdk_r06-windows/android-sdk-windows" pepflirtwindows de.hotornot "/c/Documents and Settings/Administrator/Desktop/www" "/c/Documents and Settings/Administrator/Desktop/pep"

See if that helps.

Simon Mac Donald
http://hi.im/simonmacdonald


On Fri, Sep 3, 2010 at 9:12 AM, Komal Goyal <ko...@ensarm.com> wrote:
Hi Simon,

yes I am having the android home set and the path variable contains the tools dir..

ANDROID_HOME = C:\Documents and Settings\Administrator\Desktop\android-sdk_r06-windows\android-sdk-windows
PATH = .... ;%ANDROID_HOME%\tools

:( :( :(

Do I have to start with the whole process again??

:( :( :( 

Komal

Reply all
Reply to author
Forward
0 new messages