On Ubuntu 12.10, I am trying to set up cordova 2.3.0(PhoneGap) based on the instructions present here http://docs.phonegap.com/en/2.3.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android.
but when I run the script I get the following error:
An unexpected error occurred: [ ! -e "$BUILD_PATH"/framework/libs/commons-codec-1.7.jar ]
exited with 1
Deleting project...
I looked up the commons-codec-1.7.jar and it is present where it should be:
-rw-r--r-- 1 user user 259600 Jan 21 15:32 framework/libs/commons-codec-1.7.jar
I tried hard coding the path and I still get the same error.so why am I seeing this error.
Any ideas what could be wrong or missing here?
thanks ahead
This is most likely because Java and/or Apache Ant is not installed properly. I had the same issue until I installed the Oracle JDK and Ant with the following commands:
sudo apt-add-repository ppa:webupd8team/java
sudo apt-get update && sudo apt-get install oracle-java6-installer
sudo apt-get install ant
I recommend to make create
script output more verbose to research build problems. So you can edit this line:
(cd "$BUILD_PATH"/framework && ant jar &> /dev/null )
to
(cd "$BUILD_PATH"/framework && ant jar )
This helps me to determine my problem:
makk@localhost:~/projects/eclipse/cordova-android/bin$ ./create ~/projects/eclipse/plackarta com.MyApp MyApp
Buildfile: build.xml
BUILD FAILED
/home/makk/projects/eclipse/cordova-android/framework/build.xml:33: The required minimum version of ant is 1.8.0, you have Apache Ant version 1.7.1 compiled on September 8 2010
Total time: 0 seconds
You can fix this depending on your OS. On modern systems you'll probably get luck following fiznool answer. Also you can try this solution (on your own risk!): https://askubuntu.com/questions/55488/install-upgrade-to-apache-ant-1-8-2. There are also ready-to-use binaries on http://ant.apache.org/bindownload.cgi (helped me with my old 10.04 Ubuntu).
I've had this exact same problem, I'm not sure what solved it in the end but here's a list of what I did.
I should have tried to run the command after each step to pinpoint the problem. If you find out exactly what solved it please tell.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With