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.
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.
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.
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 !
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="..." />
.
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