问题描述
尝试在Windows 8的我已经在C语言创建的一个项目中使用PhoneGap的在Eclipse:\开发\ HelloWorld的。在命令行中,当我输入:
Trying to use Phonegap in Eclipse on windows 8. I've created a project at C:\Development\HelloWorld. In the command line, when I type:
phonegap local build android
我收到以下错误:
I get the following error:
An error occurred during creation of android sub-project. ERROR : executing command 'ant', make sure you have ant installed and added to your path.
我的路径:
C:\Program Files\nodejs\;C:\Development\adt-bundle\sdk\platform-tools;C:\Development\adt-bundle\sdk\tools;%JAVA_HOME%\bin;%ANT_HOME%\bin;
去错了请告诉我?我已经下载蚂蚁在我的开发文件夹和所有其他必要的下载下载为好。任何帮助将是AP preciated。
Whats going wrong? I have downloaded Ant into my Development folder and all other necessary downloads are downloaded as well. Any help would be appreciated.
推荐答案
我在下面的PhoneGap的平台指南Android和我一直得到上述错误。在引导的方向是有点混乱。我回去检查什么我已经安装并发现了一些配置错误。
I was following Phonegap's platform guide for Android and I kept getting the above error. The directions on the guide were a little confusing. I went back to check what I had installed and found some configuration errors.
在环境变量,我创建了作为值的相应物理文件路径的新ANDROID_HOME,ANT_HOME和JAVA_HOME系统变量。这部分可能是矫枉过正,但我试图掩盖我的基地,我注意到它没有显著的问题为止。
Under Environment Variables, I created new ANDROID_HOME, ANT_HOME, and JAVA_HOME system variables with the respective physical file paths as the value. This part may be overkill, but I was trying to cover my bases and I have noticed no significant issues with it so far.
例如:
变量:ANDROID_HOME值:C:\开发\ ADT-包\ SDK
变量:ANT_HOME值:C:\开发\ Apache的ANT-1.9.2
Variable: ANT_HOME Value: C:\Development\apache-ant-1.9.2
变量:JAVA_HOME值:C:\ Program Files文件\的Java \ jdk1.6.0_45
Variable: JAVA_HOME Value: C:\Program Files\Java\jdk1.6.0_45
接下来,我增加了以下值到Path系统变量的环境变量:
Next I added the following values to the Path system variable in Environment Variables:
%JAVA_HOME%\ BIN;%ANT_HOME%\ BIN;%ANDROID_HOME%\平台工具;%ANDROID_HOME%\工具;
做了这些改变,并继续遵循指南后,一切都像它应该。它归结为不具有我的系统变量设置为正确的物理文件路径。
After making these changes and continuing to follow the guide, everything worked like it should. It boiled down to not having my system variables set to the correct physical file path.
这篇关于不能让蚂蚁为PhoneGap的使用Eclipse和Windows 8的安装正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!