12

when i compile android program in Eclipse4.3 kepler with SDK version 22.3 API level 19 than it throws an error as aapt.exe has stopped working log shows this Problem signature:

Problem Event Name: APPCRASH   
Application Name:   aapt.exe   
Application Version:    0.0.0.0 
Application Timestamp:  52684cb5
Fault Module Name:  aapt.exe   
Fault Module Version:   0.0.0.0   
Fault Module Timestamp: 52684cb5   
Exception Code: c0000005   
Exception Offset:   0003cf2a   
OS Version: 6.2.9200.2.0.0.768.101   
Locale ID:  16393   
Additional Information 1:   5861   
Additional Information 2:   5861822e1919d7c014bbb064c64908b2   
Additional Information 3:   dac6   
Additional Information 4:   dac6c2650fa14dd558bd9f448e23afd1  Read our privacy statement online:   http://go.microsoft.com/fwlink/?linkid=190175  If the online privacy statement is not available, please read our privacy statement offline:   C:\Windows\system32\en-GB\erofflps.txt

please guys help me out from this i can't even compile hello world!!!!

Qben
  • 2,617
  • 2
  • 24
  • 36
jabir jazz
  • 187
  • 1
  • 2
  • 10
  • Have a look [here](http://stackoverflow.com/questions/19803611/eclipse-kepler-crashes-when-creating-new-android-application-project?noredirect=1#comment29502912_19803611) to see if it helps. – ChuongPham Nov 18 '13 at 16:22
  • This is not the exact thing. my version of eclipse kepler is working fine for 4 months since release of kepler but when i updated the sdk API level 19 the problem started. all the things and installation are as it is like 4 months before. – jabir jazz Nov 20 '13 at 06:10
  • 1
    Can you turn on verbose build mode and post what you find from the output? In Eclipse, go to **Windows | Preferences | Android | Build | Build Output | Verbose**. Make sure you click **Apply** or **OK** afterwards to save the change. From the output log, look for any line highlighted in red or any message that is peculiarly odd. Also, your error might be related to this [bug report](https://code.google.com/p/android/issues/detail?id=61308) regarding resources referencing and validation. – ChuongPham Dec 06 '13 at 17:05
  • Following solution worked for me http://stackoverflow.com/a/20312357 – Abhijit Jan 07 '14 at 10:06

8 Answers8

36

Also there is can be problem with incorrect menu option

<item
    android:id="@+id/action_grid"
    android:icon="@drawable/ic_grid"
    android:title="Grid"
    android:showAsAction="true">

in my case an icon in drawable was absent. Eclipse doesn't notify about this. Check carefully this moment!

validcat
  • 6,158
  • 2
  • 29
  • 38
  • Note that this also solved the problem for me, although in my case it was a string resource I'd inadvertently deleted, not a drawable. Lesson: missing resources referenced from a menu XML cause an AAPT crash rather than an error. – Sterling Jan 18 '14 at 18:47
  • And apparently it's on the Android bug tracker here: https://code.google.com/p/android/issues/detail?id=61308 – Sterling Jan 18 '14 at 18:52
  • Nice! I had the missing drawable (got the wrong name), so warning on that particular item from eclipse, but aapt kept failing. Thanks! – user1676075 Jan 29 '14 at 02:13
  • Great Answer appreciate that +1 – Zubair Ahmed Sep 11 '14 at 15:08
5

In eclipse, I do this to solve it:

  1. Windows > Preferences > Android > Build > Build Ouput > Select "Verbose"

  2. Select Project > Clean > OK

  3. Select Project > Build All

  4. Select "Console" output.

You may have to flip from DDBMS to Android here, mine flips back and forth. In the Android Console you will see the exact XML discrepancy causing the problem.

Carrie Kendall
  • 11,124
  • 5
  • 61
  • 81
user3092587
  • 61
  • 1
  • 2
4

For me, it seems to be a problem with Android SDK Build Tools 19 so I downgraded to an older version, 18.1.1 in my case.

dt0
  • 713
  • 2
  • 8
  • 18
  • I've been encountering the same issue since I upgraded to 19 and had to downgrade to 18.1.1 also. – Hank Wilson Jan 12 '14 at 20:34
  • How do you downgrade? I figured out how to install 18.1.1, but I can't figure out how to tell Eclipse to use that for building. – joshlf Mar 31 '14 at 04:05
  • Oh good point. I kind of just uninstalled everything except 18.1.1 – dt0 Mar 31 '14 at 22:30
  • As an Extra: If you still need things like the ActionBar which are only in 19 an above then downgrade, clean, then upgrade back to 19. Seems to sort itself out :) +1 – JamJar00 Apr 12 '14 at 10:07
  • For me upgrading to SDK Build Tools 21.0.1 caused issue. downgraded to 21 still had issue, downgraded to 20 and the issue was resolved:) seems you need at least SDK Build Tools version 20 to get zipalign working and be able to publish your app. – Ehsan Oct 21 '14 at 20:04
2

In my case the problem was due to missing xmlns attributes for namespace prefixes used in a manually created menu file. In my case these prefixes were app:, tools: and context:. I used NetBeans Check XML feature to find and fix the syntax issues in my Android XML files. Here is how:

  1. Open XML file in NetBeans: File => Open File
  2. Use right-click in editor window for XML file and choose "Check XML"
  3. Fix errors reported
  4. Repeat "Check XML" and fix error until no more errors
Farrukh Najmi
  • 5,055
  • 3
  • 35
  • 54
2

I have too long time search for a reason... Reason of this error was: menu.xml Just I've added new Activity for a test, and then I've remove this activity with layout xml, but menu was stayed in project... and 2 hours to search solution

Anri
  • 31
  • 1
1

i found out that i had put a menu item like this :

 <item
    android:id="@+id/share_fb"
    android:icon="@drawable/ic_menu_moreoverflow"
    android:showAsAction="never"
    android:title="@string/fb invitation menu title"/>

there were spaces here :

    android:title="@string/fb invitation menu title"/>

when i removed the spaces and put the correct strings.xml value, every thing went ok, and the aapt.exe error was gone

Ahmed Adel Ismail
  • 2,168
  • 16
  • 23
-1

I had put capital S in in string tag in string resource file.
After replacing it with small letter aapt error was gone.

rtruszk
  • 3,902
  • 13
  • 36
  • 53
imthius
  • 1
  • 1
-2

Clean all your projects first and then,

Eclipse > Preferences > Android > Build > Build Output > normal

Aman Mundra
  • 854
  • 12
  • 28