Cannot get phonegap to work

166 views
Skip to first unread message

electronbender

unread,
Sep 3, 2010, 12:28:55 PM9/3/10
to phonegap
I've been trying to setup a development environment for phonegap for a
while now.
Linux, windows, you name it it doesnt work.
So in the end i am trying a clean XP install, with ADK, JDK, Ant, Ruby
installed, ANDROID_HOME, JAVA_HOME, ANT_HOME env variables set, ADK
tools, Ant\bin, JDK\bin, ruby\bin folders added to the path.
Still when i run:
C:\phonegap\bin>ruby ./droidgap c:\android-sdk-windows test
com.test.mk c:\www c
:\temp\test555

I get:
<internal:lib/rubygems/custom_require>:29:in `require': no such file
to load --
C:/phonegap/bin/lib/generate.rb (LoadError)
from <internal:lib/rubygems/custom_require>:29:in `require'
from ./droidgap:4:in `<main>'

Please help, i'm out of my mind, and have no more idea on how to get
it running...

Dave Johnson

unread,
Sep 3, 2010, 1:07:04 PM9/3/10
to electronbender, phonegap
Try the readme instructions here - it has changed just yesterday.

http://github.com/phonegap/phonegap-android/blob/master/README.md

> --
> You received this message because you are subscribed to the Google
> Groups "phonegap" group.
> To post to this group, send email to phon...@googlegroups.com
> To unsubscribe from this group, send email to
> phonegap+u...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/phonegap?hl=en?hl=en
>
> For more info on PhoneGap or to download the code go to www.phonegap.com
>

Ognen Plavevski

unread,
Sep 4, 2010, 12:13:45 PM9/4/10
to dave, phonegap
I am sorry, the instructions dont help.
I noticed the error indicates that phonegap is looking for generate.rb in bin/lib which is probably an error since lib is located in /lib.
So anyhow i copied the lib dir in /bin, so i no longer get that error.
However, now when i execute the same command, i do not get an error, but i do not get any out put as well.
What is wrong?
Tell me what output you need to diagnose the problem?

Dave Johnson

unread,
Sep 5, 2010, 1:46:46 AM9/5/10
to Ognen Plavevski, phonegap
If you are running this:

C:\phonegap\bin>ruby ./droidgap c:\android-sdk-windows test
com.test.mk c:\www c:\temp\test555

then that is for PhoneGap <= 0.9.1 and not the latest master head from github.

The latest code in github (which I assume you are using since that is
the first time we have added generate.rb) you need to use the command
line calls from the readme up on github.

If you have added the phonegap-android/bin folder to your path and you
run "droidgap" then you should see a help menu. let me know what you
see when you run that.

electronbender

unread,
Sep 5, 2010, 3:53:35 PM9/5/10
to phonegap
C:\www>droidgap run

C:\www>ruby C:\phonegap\bin\droidgap run
'/*' is not recognized as an internal or external command,
operable program or batch file.
'Licensed' is not recognized as an internal or external command,
operable program or batch file.
'contributor' is not recognized as an internal or external command,
operable program or batch file.
'this' is not recognized as an internal or external command,
operable program or batch file.
'The' is not recognized as an internal or external command,
operable program or batch file.
you was unexpected at this time.
No devices attached. Starting emulator w/ first avd...
'grep' is not recognized as an internal or external command,
operable program or batch file.
No Android Virtual Device (AVD) could be found. Please create one with
the Andro
id SDK.
'/*' is not recognized as an internal or external command,
operable program or batch file.
'Licensed' is not recognized as an internal or external command,
operable program or batch file.
'contributor' is not recognized as an internal or external command,
operable program or batch file.
'this' is not recognized as an internal or external command,
operable program or batch file.
'The' is not recognized as an internal or external command,
operable program or batch file.
you was unexpected at this time.

C:\www>

On Sep 5, 7:46 am, Dave Johnson <d...@nitobi.com> wrote:
> If you are running this:
>
> C:\phonegap\bin>ruby ./droidgap c:\android-sdk-windows test
> com.test.mk c:\www c:\temp\test555
>
> then that is for PhoneGap <= 0.9.1 and not the latest master head from github.
>
> The latest code in github (which I assume you are using since that is
> the first time we have added generate.rb) you need to use the command
> line calls from the readme up on github.
>
> If you have added the phonegap-android/bin folder to your path and you
> run "droidgap" then you should see a help menu. let me know what you
> see when you run that.
>
> On Sat, Sep 4, 2010 at 9:13 AM, Ognen Plavevski
>
>
>
> <ognen.plavev...@gmail.com> wrote:
> > I am sorry, the instructions dont help.
> > I noticed the error indicates that phonegap is looking for generate.rb in
> > bin/lib which is probably an error since lib is located in /lib.
> > So anyhow i copied the lib dir in /bin, so i no longer get that error.
> > However, now when i execute the same command, i do not get an error, but i
> > do not get any out put as well.
> > What is wrong?
> > Tell me what output you need to diagnose the problem?
>

Brian LeRoux

unread,
Sep 5, 2010, 5:51:14 PM9/5/10
to electronbender, phonegap
Those docs are a little off --- I'm in the process of updating the
README and wikis now. I just did this:

$ cd Desktop/
$ droidgap gen Testing
Generated /Users/brianleroux/Desktop/Testing
$ cd Testing/
$ droidgap create
$ cd ../Testing_android/
$ droidgap run

And it worked. Note: I had my phone plugged in. You need either a
phone or a running emulator for droidgap run to work.

By the looks of your output you had neither. You can create an AVD (an
emulator) in the Android SDK manager. I just posted a screencast on
how to use it here: http://www.youtube.com/watch?v=zCqeUEPAanE

electronbender

unread,
Sep 6, 2010, 7:40:14 AM9/6/10
to phonegap
Something is happening with the create command.
I have a Virtual device running in the background, Android 1.6...
As you can see the generated Bla_android folder is empty?

C:\>

C:\>droidgap gen Bla

C:\>ruby C:\phonegap\bin\droidgap gen Bla
Generated C:/Bla

C:\>cd Bla

C:\Bla>dir
Volume in drive C has no label.
Volume Serial Number is 5C69-2D62

Directory of C:\Bla

09/06/2010 01:34 PM <DIR> .
09/06/2010 01:34 PM <DIR> ..
09/06/2010 01:34 PM 4,458 index.html
09/06/2010 01:34 PM 1,612 master.css
2 File(s) 6,070 bytes
2 Dir(s) 1,592,311,808 bytes free

C:\Bla>droidgap create

C:\Bla>ruby C:\phonegap\bin\droidgap create
'/*' is not recognized as an internal or external command,
operable program or batch file.
'Licensed' is not recognized as an internal or external command,
operable program or batch file.
'contributor' is not recognized as an internal or external command,
operable program or batch file.
'this' is not recognized as an internal or external command,
operable program or batch file.
'The' is not recognized as an internal or external command,
operable program or batch file.
you was unexpected at this time.
'grep' is not recognized as an internal or external command,
operable program or batch file.
C:/phonegap/lib/create.rb:112:in `create_android': undefined method
`match' for
nil:NilClass (NoMethodError)
from C:/phonegap/lib/create.rb:14:in `initialize'
from C:/phonegap/bin/droidgap:19:in `new'
from C:/phonegap/bin/droidgap:19:in `<main>'

C:\Bla>dir
Volume in drive C has no label.
Volume Serial Number is 5C69-2D62

Directory of C:\Bla

09/06/2010 01:34 PM <DIR> .
09/06/2010 01:34 PM <DIR> ..
09/06/2010 01:34 PM 4,458 index.html
09/06/2010 01:34 PM 1,612 master.css
2 File(s) 6,070 bytes
2 Dir(s) 1,592,311,808 bytes free

C:\Bla>cd
C:\Bla

C:\Bla>cd ..

C:\>dir
Volume in drive C has no label.
Volume Serial Number is 5C69-2D62

Directory of C:\

09/03/2010 05:53 PM <DIR> android-sdk-windows
04/30/2010 06:03 PM <DIR> apache-ant
10/23/2009 10:58 PM 0 AUTOEXEC.BAT
09/06/2010 01:34 PM <DIR> Bla
09/06/2010 01:34 PM <DIR> Bla_android
10/23/2009 10:58 PM 0 CONFIG.SYS
10/23/2009 11:11 PM <DIR> Documents and Settings
09/05/2010 09:40 PM <DIR> java
09/04/2010 08:25 PM <DIR> phonegap
09/04/2010 06:10 PM <DIR> Program Files
09/03/2010 04:41 PM <DIR> Ruby192
09/04/2010 01:14 PM <DIR> temp
10/24/2009 06:37 PM <DIR> WINDOWS
09/03/2010 06:22 PM <DIR> www
09/06/2010 01:22 PM <DIR> www_android
2 File(s) 0 bytes
13 Dir(s) 1,592,311,808 bytes free

C:\>cd Bla_android

C:\Bla_android>dir
Volume in drive C has no label.
Volume Serial Number is 5C69-2D62

Directory of C:\Bla_android

09/06/2010 01:34 PM <DIR> .
09/06/2010 01:34 PM <DIR> ..
0 File(s) 0 bytes
2 Dir(s) 1,592,311,808 bytes free

C:\Bla_android>

electronbender

unread,
Sep 6, 2010, 4:28:14 PM9/6/10
to phonegap
Ok, i found the answer here:
http://stackoverflow.com/questions/3588534/phonegap-android-sample-project-not-building
The script needs to be changed to reffer to ant.bat not ant

But now i have a new problem:
C:\www>ruby C:\phonegap\bin\droidgap create
'grep' is not recognized as an internal or external command,
operable program or batch file.
C:/phonegap/lib/create.rb:112:in `create_android': undefined method
`match' for
nil:NilClass (NoMethodError)
from C:/phonegap/lib/create.rb:14:in `initialize'
from C:/phonegap/bin/droidgap:19:in `new'
from C:/phonegap/bin/droidgap:19:in `<main>'

This is probably something similar. What's the windows equivalent of
grep?

On Sep 5, 11:51 pm, Brian LeRoux <brian.ler...@nitobi.com> wrote:

electronbender

unread,
Sep 6, 2010, 5:09:32 PM9/6/10
to phonegap
I did it! I did it! Oh finally the agony is over! It's working!

I downloaded grep for windows, that fixed that error.

Then i got the first error again when i tried droidgap run, which i
resolved with adding .bat to ant.
So finally it's working!

Thanks to everyone for their assistance.

On Sep 6, 10:28 pm, electronbender <ognen.plavev...@gmail.com> wrote:
> Ok, i found the answer here:http://stackoverflow.com/questions/3588534/phonegap-android-sample-pr...

Dave Johnson

unread,
Sep 6, 2010, 10:03:35 PM9/6/10
to electronbender, phonegap

Yah cygwin helps a lot!

Reply all
Reply to author
Forward
0 new messages