phonegap - 无法安装android平台

时间:2014-01-29 07:49:54

标签: android cordova ant

我想尝试一下PhoneGap,所以我下载并安装并开始在phonegap文档中使用本指南:http://docs.phonegap.com/en/3.3.0/guide_cli_index.md.html#The%20Command-Line%20Interface

我已经创建了一个新项目,并使用指南中提到的命令安装了ios平台,并尝试对Android平台执行相同的操作:

cordova platform add android

我收到以下错误:

Creating android project...

/usr/local/lib/node_modules/cordova/node_modules/q/q.js:126
                    throw e;
                      ^
Error: An error occured during creation of android sub-project. 

Users/ophir/.cordova/lib/android/cordova/3.3.0/bin/node_modules/q/q.js:126
                    throw e;
                      ^
Error: ERROR : executing command 'ant', make sure you have ant installed and added to your path.
at /Users/ophir/.cordova/lib/android/cordova/3.3.0/bin/lib/check_reqs.js:47:27
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

at /usr/local/lib/node_modules/cordova/src/platform.js:244:30
at ChildProcess.exithandler (child_process.js:641:7)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Socket.<anonymous> (child_process.js:956:11)
at Socket.EventEmitter.emit (events.js:95:17)
at Pipe.close (net.js:466:12)

我看到我丢失了蚂蚁(在重新安装我的mac os之前曾经有过它)。我该怎么安装蚂蚁?

由于

2 个答案:

答案 0 :(得分:0)

如果您安装了mavericks,这个解决方案很可能适合您

https://stackoverflow.com/a/19495611/611547

答案 1 :(得分:0)

你的问题是没有安装ant,所以你必须先安装ant然后运行这个命令以确保你的蚂蚁没问题,那么手机间隙应该顺利运行:

ant -h