'aapt' error. Pre Compiler Build aborted
Asked Answered
P

2

5

I'm using Eclipse 4.2.2 with Android SDK 22.0.1 to construct an Android application which uses the Facebook and Google Play Services lib. However I'm stuck with a problem: every time I include one or both of the library the aapt verbose mode crash in some point like this (I assume this also crash with verbose mode off, because the R.java files are not created on my project):

[2013-06-21 01:33:40 - Project]     (new resource id com_facebook_placepickerfragment_list_row from /Users/Solens/workspace/FacebookSDK/res/layout/com_facebook_placepickerfragment_list_row.xml)
[2013-06-21 01:33:41 - Project]     (new resource id com_facebook_us
[2013-06-21 01:33:41 - Project] 'aapt' error. Pre Compiler Build aborted.

If I don't include the libraries the project compile correctly. I've tried several solutions like clean -> build project, trying to update the sdk tools (however I'm using the lastest revision), but any of them have worked. I even tried switching OS to Windows 7 (I use Mountain Lion) and the same problems arise.

The funny thing is I have another project which both of the libraries added, the only difference is this other project has, by far, less resources than my crashed project.

I've been stuck on this problem by two weeks and still not found a solution.

Thanks in advance.

P.S.: related question -> aapt erros when generating resource ids

Position answered 21/6, 2013 at 6:52 Comment(2)
I'm getting the same error. Did you figure out how to solve it?Hemocyte
Try using a different version of Android SDK Build Tools. With version 19 I didn't see anything except 'aapt' error. Pre Compiler Build aborted. With version 18.1.1 aapt listed the missing resources it couldn't resolve.Versus
C
8

I'm getting the same error, and try using the older android build tools as @Onko suggest in the second comment solve the problem. The android build tool v19 won't report the error in your resource files.

So what I did was, re-download the Build-tools v18 in SDK Manager and delete the v19.0.1 then restart the eclipse and clean and force eclipse to rebuild the project. After that I found what is the error in my resource xml file.

Chari answered 28/12, 2013 at 15:7 Comment(2)
I've tried this solution with another projects and it actually works. I left behind this project and moved with my life. Thanks!Position
IT worked for me downloading the latest v19 and 20 Build Tools. Now I can continue programming. Thanks guys.Asymptote
H
1

I've been stuck at this nasty error at least few times and every time I lost hours to find the exact cause. One possible reason could be something malformed in a menu XML. In example ifRoom is misspelled.

<menu xmlns:android="http://schemas.android.com/apk/res/android" >    
    <item
        android:showAsAction="iFroom|withText" 
        ...
    />

</menu>    

It is not detected by the XML editor. Nor it is reported as an error. Aapt just crashes without error message. Also be cautious about other kind of misspell mistakes in the menu XML. It seems the menu XML verification tool is not fully complete.

Huntingdon answered 22/4, 2014 at 16:9 Comment(2)
I was thinking in something like this, however I had not time to do a deeper debugging in that project. I'm developing again with Android, I will put a lot of attention to the xml files. Thanks!Position
+1 even though my was not misspelling of ifRoom, but it helped me resolve my problem by not wasting hours looking elsewhere..this problem persist if there's an error in the menu, in general..thanks bro..Gallantry

© 2022 - 2024 — McMap. All rights reserved.