Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cordova ./create function not found Ubuntu 12.04

Tags:

linux

cordova

I'm digging around in PhoneGap to build a quick prototype we need. When I navigate to the

~/cordova-2.1.0/bin$

and run

./create ~/jdphonegap com.jdphonegap.app JDPhoneGap

I get the following error

unexpected operator ./create: 48: ./create: function: not found

I'm not the only one:

https://groups.google.com/forum/?fromgroups=#!topic/phonegap/uI_rmd-Gto0

A little help?

like image 644
lars_bx Avatar asked Jan 19 '26 20:01

lars_bx


1 Answers

  1. Change the first line in create script from

    #! /bin/sh
    to

    #!/bin/bash

  2. Download commons-codec-1.6 from main server: http://archive.apache.org/dist/commons/codec/binaries/commons-codec-1.6-bin.tar.gz
    Extract the commons-codec-1.6.jar and place it to the cordova-android/framework/libs/ (need to create libs)
    Alternatively change the URL of this package in create script at line 96

  3. Install ant if you don't have it: http://archive.apache.org/dist/ant/ant-current-bin.zip, extract and add the ant bin folder in your PATH
    Example for ant installed in /usr/local:

    export PATH=/usr/local/ant/bin:$PATH

Then you can run the create script as documented.

like image 174
JScoobyCed Avatar answered Jan 22 '26 12:01

JScoobyCed