Eclipse and Android SDK issue "aapt.exe has stopped"
Asked Answered
M

12

15

I'm having an issue on my Windows 7 64-bit machine with aapt.exe. It is throwing the following error:

aapt.exe has stopped working

Its not project related, Since i've tried multiple projects, it seems to happen with any workspace in Eclipse as well. New project or old project it just keeps failing when building and running my application.

I'm using the latest JDK-6 with the latest Android SDK 22.0.1, with Build Tools and Platform tools.

Deleting the entire SDK and Eclipse and unziping and resetting up doesnt seem to resolve it either.

Any ideas?

Malave answered 30/5, 2013 at 5:31 Comment(6)
When did you begin experiencing this? Have you recently updated anything?Vraisemblance
Just started today, i just updated to the latest version of the Android SDK tools. Rev 22.0.1. developer.android.com/tools/sdk/tools-notes.htmlMalave
Do you know what version you where on prior to updating?Vraisemblance
rev 22 of the sdk tools, im using Eclipse version 4.2.2Malave
I am sure you have gone through these things but I want to make sure. Is your Android SDK directory properly set? Have you also updated ADT? You said it is not project specific but have you confirmed if this problem persists with a new project and no other project open in your wrokspace?Vraisemblance
@LarryMcKenzie Yes i have confirmed that ADT is the latest version, SDK has been reinstalled and is properly set in Eclipse. I've tried new workspaces and new projects alone and with other's and it keeps happening. Its extremely weird. I cant think of what else to try...Malave
D
17

Remove id from style like here @+id then build again you get success...

<item name="android:id">@+id/calender</item>
Decastro answered 6/8, 2013 at 10:33 Comment(2)
Um, so which id are we meant to remove? The android:id or the @+id? Could you please put what the line should look like after the id is removed? Thanks!Jeffrey
Anybody know why this issue happens?Frustrate
G
16

it seems you were missing some entries in strings.xml

in my case I was deleting <string name="action_settings">Settings</string>

thinking it was not used by the project and placing it back solved the issue. You can search for same or similar type of tag in you project.

Gelding answered 1/12, 2013 at 13:0 Comment(2)
+1 This solved my crash problem. Crashed on menu <item> if the string name was mistyped. Did nobody test this code on error conditions?Cybele
Pleased to know it helped you. Thanks for voting upGelding
W
8

This can also happen if you have an incorrect option in an item. Example:

<item
    android:id="@+id/menu_dashboard_add_group"
    android:icon="@android:drawable/btn_plus"
    android:title="Add group"
    android:showAsAction="true">

Note the true that is invalid for android:showAsAction

Whereof answered 22/12, 2013 at 7:51 Comment(0)
D
4

Happens when you don't put @+id/ in menus/layout xml files.

Dome answered 27/11, 2013 at 12:41 Comment(0)
A
4

Apparently it seems that the only thing that worked for me was writing back the resourse <string name="action_settings">Settings</string> after which the problem appeared. Actually I erased it in the first place because it was not used througout my open project...

Amorette answered 28/1, 2014 at 15:44 Comment(0)
C
2

For me, this happened when I included a ” or ' character. I'd replaced the apostrophe with &apos;, but aapt still wanted the prefixing backslash.

Camala answered 1/11, 2013 at 0:25 Comment(0)
S
2

Not sure but please try to use the Android SDK Build-Tools v18.1.1 instead of 19.0.1

It might be the case that you have error in your resource files, the v19 build-tools won't report the error but keep failing to compile the R.

Please read more detail in the 2nd comment of the question below. I also wrote the some steps I went through in the first reply. hope this will help solving your problem.

'aapt' error. Pre Compiler Build aborted

Storyteller answered 28/12, 2013 at 15:15 Comment(0)
R
2

Donot forget + sign for id attributes in menu.xml files

<item android:id="@id/action_download_time"

vs

<item android:id="@+id/action_download_time"
Rascality answered 21/3, 2014 at 11:6 Comment(0)
D
2

Check if you have any string values with html codes such as non-breaking-space (&nbsp;) Remove them and clean the project. It should work.

Ram

Deuteranope answered 14/5, 2014 at 9:54 Comment(0)
B
2

For me it happend after creating a new activity by

your_package-Right-Click-> Create a new-> "Android Activity"->Fill fields->"Done"

I solved it by reverting to previous version of my app

Belleslettres answered 12/11, 2014 at 9:10 Comment(0)
B
2

It also happend for me IF ASSETS FOLDER exist any file without resolution

for examle: if ASSETS FOLDER exist any file

file:///android_asset/html/qwwww

[result] BUG! “aapt.exe has stopped”

To solve it all files should have a resolution

file:///android_asset/html/qwwww.css
Belleslettres answered 12/11, 2014 at 9:43 Comment(0)
D
1

For me it was the buildToolsVersion '21.0.0' the old one buildToolsVersion '20.0.0' works for me but the newer one crashes the aapt.exe.

Dross answered 27/7, 2015 at 18:26 Comment(1)
This fixed my issue!Kindness

© 2022 - 2024 — McMap. All rights reserved.