我是“phonegap”的新用户我刚刚在Win7 x64 PC上安装了所有必要的工具,以便让我的第一个Android应用程序运行(在http://phonegap.com/install安装后)
- >每个帮助都非常感谢,提前感谢!!
按照命令
npm install -g phonegap
phonegap创建myapp
- 醇>
phonegap build local android
我一直在cdm中收到以下错误消息:
E:\Android development\nodejs\mmiapp>phonegap local build android
[phonegap] adding the Android platform...
C:\Users\Reen\.cordova\lib\android\cordova\3.5.0\bin\node_modules\q\q.js:126
throw e;
^
Error: ERROR : executing command 'ant', make sure you have ant installed and add ed to your path.
at C:\Users\Reen\.cordova\lib\android\cordova\3.5.0\bin\lib\check_reqs.js:47:27
at ChildProcess.exithandler (child_process.js:651:7)
at ChildProcess.emit (events.js:98:17)
at maybeClose (child_process.js:755:16)
at Socket.<anonymous> (child_process.js:968:11)
at Socket.emit (events.js:95:17)
at Pipe.close (net.js:465:12)
{ [Error: C:\Users\Reen\.cordova\lib\android\cordova\3.5.0\bin\create.bat: Command failed with exit code 8] code: 8 }
[error] C:\Users\Reen\.cordova\lib\android\cordova\3.5.0\bin\create.bat: Command failed with exit code 8
这些是我的应用/程序目录:
Nodejs: E:\Android development\nodejs
AndroidSDk: E:\Android development\sdk
Workspace: E:\Android development\Workspace
Eclipse: E:\Android development\eclipse
Git: E:\Android development\nodejs\package\Git
Apache ant: C:\Program Files\apache-ant-1.9.4
Java JDK: C:\Program Files\Java\jdk1.8.0_05
cordova: C:\Users\Reen\.cordova\lib\android\cordova\3.5.0\bin\lib
遵循Win7环境变量(用户变量“用户”:)
"Android_Home": E:\Android development\sdk
"SDK": E:\Android development\sdk\tools
"Ant_Home": C:\Program Files\apache-ant-1.9.4
"JDK_Home": C:\Program Files\Java\jdk1.8.0_05
遵循Win7 sys变量(系统变量:)
E:\Android development\nodejs\;E:\Android development\nodejs\package\Git\cmd; C:\Program Files\Java\jdk1.8.0_05\bin;C:\Program Files\apache-ant-1.9.4\bin
更新
好的,我错过了正确安装cordova ...
重复推荐行之后的步骤
npm install -g cordova
and getting the following message now:
E:\Android development\nodejs\mmiapp>phonegap build local android
C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\build.js:83
self.phonegap.emit('log', PG_STR.msgdet[0], platform.human, PG_STR.msgdet[
^
TypeError: Cannot read property 'human' of undefined at BuildCommand.execute (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\build.js:83:57)
at BuildCommand.run (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\build.js:65:10)
at PhoneGap.build (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\phonegap\util\command.js:28:25)
at CLI.module.exports [as build] (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\cli\build.js:35:14)
at CLI.module.exports [as argv] (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\lib\cli\argv.js:66:17)
at Object.<anonymous> (C:\Users\Reen\AppData\Roaming\npm\node_modules\phonegap\bin\phonegap.js:26:21)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
从6月2日下午9:38更新
我只是试了一下,试图通过cdm
e:\Android development\nodejs\mmiapp>npm install -g apache ant
npm WARN engine ant@0.2.0: wanted: {"node":"~0.8.0"} (current:
{"node":"v0.10.29 ","npm":"1.4.14"})
ant@0.2.0 C:\Users\Reen\AppData\Roaming\npm\node_modules\ant`