Reputation: 1747
I'm trying to set up Cordova for Andoid app development. I'm following this guide: http://cordova.apache.org/docs/en/2.7.0/guide_getting-started_android_index.md.html#Getting%20Started%20with%20Android . I'm running the latest Linux Mint 15.
So far, I've got the Android Developer Tools bundle installed, OpenJDK running Java version 1.7.0, and Ant 1.8.2 installed. I've added /tools and /platform-tools to my $PATH environment variable. Of course, I also have the Cordova Android SDK unzipped and ready to go. Ant and Java were installed with the package manager; ADT bundle / Android SDK and Cordova were unzipped into my home directory.
I try to run the following command per the getting started guide, but the script fails on an Ant build operation. I have very little experience with the Java and Android stacks and am having trouble figuring out how to continue.
./create ../../workspace/project com.nelson.wells myfirstapp
BUILD FAILED
/home/nelson/Development/adt-bundle-linux/sdk/tools/ant/build.xml:650: The following error occurred while executing this line:
/home/nelson/Development/adt-bundle-linux/sdk/tools/ant/build.xml:691: Execute failed: java.io.IOException: Cannot run program "/home/nelson/Development/adt-bundle-linux/sdk/build-tools/android-4.2.2/aapt": error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1042)
at java.lang.Runtime.exec(Runtime.java:615)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:631)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
at com.android.ant.AaptExecTask.execute(AaptExecTask.java:699)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at com.android.ant.IfElseTask.execute(IfElseTask.java:120)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.Sequential.execute(Sequential.java:68)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.taskdefs.MacroInstance.execute(MacroInstance.java:398)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:390)
at org.apache.tools.ant.Target.performTasks(Target.java:411)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.Main.runBuild(Main.java:809)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Caused by: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.forkAndExec(Native Method)
at java.lang.UNIXProcess.<init>(UNIXProcess.java:135)
at java.lang.ProcessImpl.start(ProcessImpl.java:130)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1023)
... 46 more
Total time: 1 second
An unexpected error occurred: ant jar > /dev/null exited with 1
Deleting project...
I know the file exists and my user has permission to execute it, though.
file /home/nelson/Development/adt-bundle-linux/sdk/build-tools/android-4.2.2/aapt
/home/nelson/Development/adt-bundle-linux/sdk/build-tools/android-4.2.2/aapt: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.8, not stripped
nelson@nelson-VirtualBox ~/Development/cordova-2.7.0/bin $ ls -la /home/nelson/Development/adt-bundle-linux/sdk/build-tools/android-4.2.2/aapt
-rwxrwx--- 1 nelson nelson 1122758 May 13 12:31 /home/nelson/Development/adt-bundle-linux/sdk/build-tools/android-4.2.2/aapt
nelson@nelson-VirtualBox ~/Development/cordova-2.7.0/bin $
Any ideas about what's going on?
Upvotes: 3
Views: 3408
Reputation: 883
If you're using Ubuntu, I would suggest having a look at this: http://blog.mx17.net/2012/10/25/android-on-ubuntu-ioexception-on-aapt/. You may need to install the 32-bit libraries. Depending on your version of Ubuntu, that might mean:
sudo apt-get install ia32-libs
Or perhaps something like:
sudo apt-get install libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 libstdc++6:i386
See https://askubuntu.com/questions/107230/what-happened-to-the-ia32-libs-package for more.
Upvotes: 10