Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
301 views
in Technique[技术] by (71.8m points)

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

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Hit this again today, and discovered that verbose output from aapt doesn't help. It just spits out the aapt command to the console and fails without an error.

I think I've finally gotten to the bottom of what's going wrong. I believe that aapt is failing due to insufficient memory. My Eclipse process was using 1.2GB of memory. When Eclipse runs aapt, it forks the process which, from what I understand, allocates another 1.2GB just for running aapt.

I looked at my process list, and saw that Firefox was using almost 400MB of memory. I killed Firefox, and then aapt started working. Crazy.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...