Question

I'm using the latest version of the ADT Bundle downloaded on the android developers site. I'm on Windows 7. My R.java file is not compiling correctly due to the fact that I get the following crash message from Windows:

Error message

Here is the problem details output:

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.1.7601.2.1.0.256.1
  Locale ID:    1033
  Additional Information 1: 0a9e
  Additional Information 2: 0a9e372d3b4ad19135b953a78882e789
  Additional Information 3: 0a9e
  Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Read our privacy statement online:
  http://go.microsoft.com/fwlink/?linkid=104288&clcid=0x0409

If the online privacy statement is not available, please read our privacy statement offline:
  C:\Windows\system32\en-US\erofflps.txt

Now because of this, my R.java file keeps disappearing and the following problems show up:

Error console

Take note of the first problem on that list

Now I've went through the following steps about 10 times:

1. Uncheck build automatically
2. Clean project,
3. Check build config
4. Rebuild project

If your going to say to do any of this as a solution then don't post a solution because I'm not going to do something I've already done a billion times.

I ported this project over from Android Studio from all its errors and, in my experience with Eclipse, I've never seen this aapt.exe error. What is aapt.exe and what's its purpose?

Any help is greatly appreciated.

Andrew

Was it helpful?

Solution

I would like to thank you for all the help provided. After about 2 hours of comparing files with files and about 50 Google searches, I fixed it.

It turns out that my menu xml file named main_menu.xml had an extra line of code that didn't need to be there. See code below and read comment:

<!-- This top line is the problem -->
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@id/action_about"
        android:icon="@drawable/action_about"
        android:orderInCategory="1"
        android:title="@string/action_about"/>
    <item
        android:id="@id/action_settings"
        android:orderInCategory="100"
        android:title="@string/action_settings"/>

</menu>

Now the following code is the solution that fixed my R.java file generation failure:

<!-- The xml version/encoding line is gone and everything is working fine now -->
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/action_about"
        android:icon="@drawable/action_about"
        android:orderInCategory="1"
        android:showAsAction="always"
        android:title="@string/action_about"/>
    <item
        android:id="@+id/action_settings"
        android:orderInCategory="2"
        android:showAsAction="never"
        android:title="@string/action_settings"/>

</menu>

So now everything works great!

Again, thanks for all the help!

OTHER TIPS

That is not the issue Andrew. The problem is the type mismatch. you might have declared an object variable with different type and you are trying to assign an object of different type. Thanks

AAPT is the Android build tool that packages resources; it's used by both ADT and Android Studio. The most common crash I know of is due to bug https://code.google.com/p/android/issues/detail?id=42752. The cause usually seems to be a reference to a nonexistent string in one of your menu resources. Look for that and see if it clears up your crash. See also Execution failed app:processDebugResources Android Studio.

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 wre app: tools: 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

In my case the issue was with my menu file (main.xml) , in the following line: android:icon="@drawable/ic_action_search"

I am making reference to a non-existent drawable. If you are having these error my advice is to check your menu files and check if you are not referencing any non-existing resource such as @string or @drawable.

I had the same problem. I resolve it by removing the xml menu file.

I install the latest ADT always. After 1 or 2 days when I start eclipse i get the aapt error. I'm using libGDX to create games, i don't have any xml files like the problems above..

I'm sick of deleting and extracting the ADT daily.. Is someone else in the same problem?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top