3

I'm having issues with the IDE Processing.

I'm trying to compile something to Android. I'm on Android Mode, of course. But I'm getting this Error at the time of compiling. (It's not the code itself)

I've installed "adb devices", it seems Ok. I've done all the "51-android.rules" process. I've installed API 10(the one requested) and Android Tools. I don't really know what should be wrong.

-----------------
API<=15: Adding annotations.jar to the classpath.
     [echo] ----------
     [echo] Building Libraries with 'debug'...
   [subant] No sub-builds to iterate on

-code-gen:
Merging AndroidManifest files into one.
Manifest merger disabled. Using project manifest only.
     [echo] Handling aidl files...
No AIDL files to compile.
     [echo] ----------
     [echo] Handling RenderScript files...
No RenderScript files to compile.
     [echo] ----------
     [echo] Handling Resources...
Generating resource IDs...

BUILD FAILED
/home/user/adt-bundle-linux-x86_64-20130729/sdk/tools/ant/build.xml:649: The following error occurred while executing this line:
/home/user/adt-bundle-linux-x86_64-20130729/sdk/tools/ant/build.xml:690: Execute failed: java.io.IOException: Cannot run program "/home/user/adt-bundle-linux-x86_64-20130729/sdk/build-tools/18.0.1/aapt" (in directory "/tmp/android8933435574063638939sketch"): java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
    at java.lang.Runtime.exec(Runtime.java:593)
    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.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    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.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    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.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    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.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    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 processing.mode.android.AndroidBuild.antBuild(AndroidBuild.java:415)
    at processing.mode.android.AndroidBuild.build(AndroidBuild.java:73)
    at processing.mode.android.AndroidMode.handleRunDevice(AndroidMode.java:220)
    at processing.mode.android.AndroidEditor$14.run(AndroidEditor.java:310)
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:148)
    at java.lang.ProcessImpl.start(ProcessImpl.java:65)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
    ... 44 more

Total time: 2 seconds

The problem is on this part of the script from "build.xml":

   <echo level="info">----------</echo>
    <echo level="info">Handling Resources...</echo>
    <aapt executable="${aapt}"
            command="package"
            verbose="${verbose}"
            manifest="${out.manifest.abs.file}"
            originalManifestPackage="${project.app.package}"
            androidjar="${project.target.android.jar}"
            rfolder="${gen.absolute.dir}"
            nonConstantId="${android.library}"
            libraryResFolderPathRefid="project.library.res.folder.path"
            libraryPackagesRefid="project.library.packages"
            libraryRFileRefid="project.library.bin.r.file.path"
            ignoreAssets="${aapt.ignore.assets}"
            binFolder="${out.absolute.dir}"
            proguardFile="${out.absolute.dir}/proguard.txt">
        <res path="${out.res.absolute.dir}" />
        <res path="${resource.absolute.dir}" />
    </aapt>

According to the error log, this is the line 690: proguardFile="${out.absolute.dir}/proguard.txt">

But I donnt know what to do. Could you please give me a hand on this? I'm wasting so much time in this. I'm in trouble with this since yesterday morning. I've searched on google with no help.

EDIT:

I've deleted and re-installed the tools packages and the console of SDK Manager gave me this error:

Validate XML: https://dl-ssl.google.com/android/repository/sys-img/x86/sys-img.xml
Parse XML:    https://dl-ssl.google.com/android/repository/sys-img/x86/sys-img.xml
  Found Intel x86 Atom System Image, Android API 10, revision 2
  Found Intel x86 Atom System Image, Android API 15, revision 1
  Found Intel x86 Atom System Image, Android API 16, revision 1
  Found Intel x86 Atom System Image, Android API 17, revision 1
Done loading packages.
Preparing to install archives
Downloading Android SDK Platform-tools, revision 18.0.1
Installing Android SDK Platform-tools, revision 18.0.1
**Stopping ADB server failed (code -1).**
Installed Android SDK Platform-tools, revision 18.0.1
Downloading Android SDK Build-tools, revision 18.0.1
user2383501
  • 49
  • 2
  • 5
  • did you check this file?/home/user/adt-bundle-linux-x86_64-20130729/sdk/tools/ant/build.xml:690: Execute failed: java.io.IOException: Cannot run program "/home/user/adt-bundle-linux-x86_64-20130729/sdk/build-tools/18.0.1/aapt" (in directory "/tmp/android8933435574063638939sketch"): java.io.IOException: error=2, No such file or directory – kvh Aug 15 '13 at 13:23
  • Yes sir, and it's there. It all seems ok. There's no missing file I presume. I'm new to Java, I used to program in C/C++, but I've used Processing before and Android programming too, a little bit. I just do not know why this is happening. However I've edited the question, I hope that gives you some more useful information. – user2383501 Aug 15 '13 at 13:28
  • sorry, i have never build a android app on linux environtment, can't solve your problem. but i hope someone can help you – kvh Aug 15 '13 at 13:32
  • @user2383501 make sure you also install the GoogleAPIs, not just the SDK tools – George Profenza Aug 18 '13 at 10:38

1 Answers1

0

I've been experiencing this issue as well, and apparently there are 2 possible causes:

  • Apparently the location of aapt has been changed by a recent version of the SDK tools, v22. I'm not sure if removing that version of the tools would fix it, or if that would be recommended. This thread has some fixes that might work.

  • If this doesn't fix the problem, you may be trying to run the 32 bit aapt on a 64 bit system without the 32 bit runtime installed. In this case the fix from this thread may fix the issue:

    sudo apt-get --no-install-recommends install ia32-libs-multiarch

In my case, only the second of these fixes was necessary. By the way, I should point out that I was building android via Phonegap, so the use case may not match 100%. However, the same problem was occurring on the exact same line, where ant tries to execute aapt.

(Aside: The problem isn't necessarily on line 690 specifically, I think that line 690 is just given because it's the end of the "clause" specifying the execution of aapt.)

Community
  • 1
  • 1