开发者

phonegap android sample project not building

开发者 https://www.devze.com 2023-01-14 11:27 出处:网络
I\'m trying to follow the setup instructions on phonegap-android\'s wiki page, but I\'m having trouble.I\'ve got all of the prereqs/path variables/etc set-up, but when I execute the command (in gitbas

I'm trying to follow the setup instructions on phonegap-android's wiki page, but I'm having trouble. I've got all of the prereqs/path variables/etc set-up, but when I execute the command (in gitbash as per the instructions) for building the project, I get errors which I do not understand.

Here is the script which I run:

$ ruby ./droidgap "C:/android-sdk-windows" pgtest com.example.android.pgtest "C
:/xfer/input" "C:/xfer/output"

and here is the result I get:

Building the JAR...

'/*' 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.

Creating Android project for target level 8

Adding www folder to project...

Generating manifest...

Copying over libraries and assets and creating phonegap.js...

c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1418:in stat': No such file or directory

- c:/Users/<user>/Desktop/phonegap/framework/phonegap.jar (Errno::ENO

ENT)

from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1418:inblock in fu_each_sr

c_dest'

from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1432:in fu_each_src_dest0'

from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:1416:infu_each_src_dest'

from c:/Ruby192/lib/ruby/1.9.1/fileutils.rb:391:in cp'

from ./droidgap:82:incopy_libs'

from ./droidgap:20:in run'

from 开发者_如何学JAVA./droidgap:157:in'

I've looked through the phonegap forums, and I've found some hits on part of the error (the part where phonegap.jar could not be found), but nothing on the first part ("_ is not recognized", etc.). What am I doing wrong? Thanks.

Additional info:

-Windows 7 (32 bit)

-ruby 1.9.1

-java jdk1.6.0_21

-ant 1.8.1


Got it working. I remembered reading that windows users sometimes needed to add ".bat" to the end of certain commands, so I changed ant to ant.bat in the droidgap script and it worked.

Also, this guy had the same issue as me and I somehow missed it.


I've had various problems with building the Example PhoneGap App (http://wiki.phonegap.com/w/page/16494774/Getting-started-with-Android-PhoneGap-in-Eclipse)

Some of the error messagesI had are: - in `': No such file or directory - android-sdk-path.bat android.bat (Errno::ENOENT) - instat': No such file or directory - ~/projects/phonegap-android/framework/phonegap.jar

BUT IT'S NOW FIXED!!!

To fix the issues I had to tweak a lot of things , so I'm not too sure which one fixed what, but here's my system in the end (note: I'm on Windows Vista)

COMPATIBLE versions - apache ant 1.8.2 - Ruby 1.8.7 - Java SDK 1.6 - Git Bash 1.7.3.1

Environment Variables: - ANDROID_HOME = \android-sdk-windows - ANT_HOME = \apache-ant-1.8.2 - JAVA_HOME = \jdk1.6.0_13 - RUBY_HOME = \Ruby187 - PHONEGAP_ANDROID = \phonegap-android - Path - add these %JAVA_HOME%\bin;%ANT_HOME%\bin;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools;%RUBY_HOME%

\bin;%PHONEGAP_ANDROID%\bin

Using Git Bash - use NEW METHOD - ruby bin/droidgap create example RESULT: successfully created two outputs; a file called 'PhoneGap.jar' and an Android Eclipse project to be imported into Eclipse

Hope this helps

0

精彩评论

暂无评论...
验证码 换一张
取 消