Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
261 views
in Technique[技术] by (71.8m points)

android - Cannot get ant installed properly for phonegap using eclipse and windows 8

Trying to use Phonegap in Eclipse on windows 8. I've created a project at C:DevelopmentHelloWorld. 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.

My PATH:

C:Program Files
odejs;C:Developmentadt-bundlesdkplatform-tools;C:Developmentadt-bundlesdkools;%JAVA_HOME%in;%ANT_HOME%in;

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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.

Example:

Variable: ANDROID_HOME Value: C:Developmentadt-bundlesdk

Variable: ANT_HOME Value: C:Developmentapache-ant-1.9.2

Variable: JAVA_HOME Value: C:Program FilesJavajdk1.6.0_45

Next I added the following values to the Path system variable in Environment Variables:

%JAVA_HOME%in;%ANT_HOME%in;%ANDROID_HOME%platform-tools;%ANDROID_HOME%ools;

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...