1

I am working on Salesforce Touch; I am new with this platform. I am referring to the Salesforce Touch guide. I am trying to create a native Android project, using this command

ant create_native -Dapp.name={DemoApp} -Dtarget.dir={C:\Anu Raj\project\Salesforce Touch} -Dpackage.name={com.acme.mobileapp}"  

but i am getting this error while doing this --- > "

The term 'ant' is not recognized as the name of a cmdlet, function, script file
, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:4
+ ant <<<<  create_native -Dapp.name={DemoApp} -Dtarget.dir={C:\Anu Raj\project
\Salesforce Touch} -Dpackage.name={com.acme.mobileapp}
    + CategoryInfo          : ObjectNotFound: (ant:String) [], CommandNotFound
   Exception
    + FullyQualifiedErrorId : CommandNotFoundException"

can anybody tell me what is the issue for this.

  • is apache ant installed? Did you correctly set your global variables? ant.apache.org/manual/install.html – pjcarly Nov 14 '12 at 11:06
  • Please do not add random tags to your question. This has nothing to do with Force.com Sites, or Eclipse! – metadaddy Nov 14 '12 at 17:51
5

This is probably because its not able to find the ant executable in your Path. I'm assuming you've installed Apache Ant. (http://ant.apache.org/bindownload.cgi)

Assuming you're on Windows, you need to set your ANT_HOME and add the ant bin to your PATH environment variable

So My Computer > Proprties > Advanced System Settings > Environment Variables

Add a new Variable called ANT_HOME Set the value to be the base directory of your apache ant installation, eg :

ANT_HOME Environment Variable

Then add the location of the ANT Bin directory to your PATH Variable, which will already exist. eg : Add ;C:\apache-ant-1.8.4\bin to the end of the PATH System Variable

Set the ANT bin directory to your PATH Environment Variable

After you've done this, you will need to launch a new command window and then ant can be used.

Even now, ant will work if you explicitly navigate to the Ant Installation's bin directory and type ANT.

  • thanks i did the same but i am getting this error when i run the Git shell - Resolve-Path : Cannot find path 'C:\Users\srcloud\.ssh\id_rsa' because it does not exist. At C:\Users\srcloud\AppData\Local\GitHub\PoshGit_8d80d7433eabc8de6af51eeecef5be a516df4997\GitUtils.ps1:249 char:32 + $sshPath = Resolve-Path <<<< ~/.ssh/id_rsa + CategoryInfo : ObjectNotFound: (C:\Users\srcloud\.ssh\id_rsa:St ring) [Resolve-Path], ItemNotFoundException + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.Resol vePathCommand – AnuRaj Nov 14 '12 at 14:26
  • That's not a problem related to Ant; that is Git not being able to find your private key so that you can connect to a source control repository. If you are unfamiliar with Git I suggest searching for a tutorial because that is beyond the scope of this site. – Mike Chale Nov 14 '12 at 18:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.