安装的PhoneGap,错误执行命令“蚁族”

问题描述:

在通过nodeJS安装PhoneGap的尝试运行我的应用程序(PhoneGap的安装和创建应用程序工作)时,我得到了一个错误:

When installing PhoneGap via nodeJS i got an error when trying to run my app (installing phonegap and creating the app worked):

C:\Users\arko\my-app>phonegap run android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
    [error] An error occured during creation of android sub-project.

C:\Users\arko\.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 add
ed to your path.
    at C:\Users\arko\.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:465:12)

所以,我发现我从来没有装过蚂蚁,所以我做到了。我跟着这个教程:http://clean$c$cdevelopment-qualityseal.blogspot.nl/2012/11/how-to-install-phonegap-for-android.html和所做的一切,它说。

So I noticed I never had ANT installed, so I did. I followed this tutorial: http://cleancodedevelopment-qualityseal.blogspot.nl/2012/11/how-to-install-phonegap-for-android.html and done everything it said.

它说你要添加的东西到PATH变量中的一部分,它说只是补充一点:%ANT_HOME%\ BIN; C:但是我的路径与此结束\ Program Files文件\的Windows Live \共享 - 所以我说这是:;%ANT_HOME%\ bin中;

The part it says you have to add stuff to the Path variable, it said just add this: %ANT_HOME%\bin; however my Path ended with this: C:\Program Files\Windows Live\Shared - so I added this to it: ;%ANT_HOME%\bin;

试图再次运行Android应用程序,并得到了同样的错误。我跑它用这个命令:

Tried to run the android app again, and got the same error. I ran it with this command:

phonegap run android

我是什么做错了吗?

What am I doing wrong?

谢谢!

也许你有科尔多瓦的一个新版本,我看到,在一个合作伙伴的机器被安装在科尔多瓦版本3.5.0,并在我的机器与安装3.4 2.0版本,也许蚂蚁版本与科尔多瓦的新版本不兼容(他和我有蚂蚁版本1.9.4)。

Probably you have a new version of cordova, i saw that in a partner machine was installed the cordova version 3.5.0 and in my machine it was installed the 3.4.0 version, maybe the ant version is incompatible with the new version of cordova (He and i has the ant version 1.9.4) .

尝试安装旧版本科尔多瓦在Node.js的控制台命令:

Try install a old version of cordova with this command in the node.js console:

    npm install -g cordova@3.4.0-0.1.0 

和再次运行该命令。

其他的原因:确认PATH变量的配置是否正确。

Other cause: Verify that your Path Variables are configured correctly..

我的英文不是pretty的不错,但我希望帮你解决问题。

My english is not pretty good, but i hope help you to solve the problem.