Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to diagnose "Error executing aapt" error in Eclipse?

Tags:

android

I'm ready to tear my hair out because I can't get Eclipse unstuck from a state where it thinks it can't find aapt:

Error executing aapt. Please check aapt is present at /usr/local/android-sdk-linux_x86/platform-tools/aapt

I've found a bunch of posts on this subject, which suggest deleting the error in the Eclipse UI, deleting R.java, rebuilding the project, restarting Eclipse, etc. These things help temporarily, but as soon as I edit an XML file, Eclipse gets borked again. It's getting really annoying to rebuild all my source and restart Eclipse every time I change an XML file.

aapt is clearly there:

$ ls -l /usr/local/android-sdk-linux_x86/platform-tools/aapt
-rwxr-xr-x 1 boris boris 3764858 2011-07-28 11:50 /usr/local/android-sdk-linux_x86/platform-tools/aapt

Is there a way to know exactly what the error is that's occurring? I tried looking in the Eclipse console output and in .metadata/.log in my project and didn't see anything related.

like image 612
Boris Burtin Avatar asked Aug 26 '11 00:08

Boris Burtin


4 Answers

Finally found the answer to my question here:

http://groups.google.com/group/android-developers/browse_thread/thread/bad9d488d2068260

Turns out that you can see the aapt command and output by setting "Build output" to "Verbose" in Preferences/Android/Build. Weird that they don't spit out the output when an error occurs.

like image 158
Boris Burtin Avatar answered Nov 03 '22 02:11

Boris Burtin


In my case (fresh Eclipse installation, new project generated with wizard, errors like "Couldn't resolve R to variable") the problem turned out to be with absense of trailing slash in path to Android SDK at Preferences->Android.

like image 43
MarSoft Avatar answered Nov 03 '22 01:11

MarSoft


Hint (suggested by Eclipse on Ubuntu): On 64-bit systems, make sure the 32-bit libraries are installed: sudo apt-get install ia32-libs

That has solved my problem !

like image 4
nonozor Avatar answered Nov 03 '22 00:11

nonozor


I had this because of a misdeclared ID in one of the resources files. I'm using Android Studio (but not gradle), and I had in a style declaration a reference to an @+id/... which isn't allowed, apparently. I had to declare the ID in another values xml files as <item type="id" name="..." />.

like image 2
Benoit Duffez Avatar answered Nov 03 '22 02:11

Benoit Duffez