Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Issue with aapt.exe

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

like image 308
Andrew Quebe Avatar asked Dec 29 '13 20:12

Andrew Quebe


People also ask

What is AAPT EXE?

aapt.exe is the Android Asset Packaging Tool (aapt). It's designed to take your application resource files, such as the AndroidManifest. xml file and other XML files used for every "Activity" in your Android app, and compile them.

Where is AAPT located?

Where it is. In the SDK, aapt is found in the $ANDROID_HOME/platforms/$SDK/tools/ directory of the SDK (where $SDK is the name of some Android version, like android-2.1).

Where is AAPT located Android SDK?

aapt stands for Android Asset Packaging Tool and is included in the tools/ directory of the SDK. This tool allows you to view, create, and update Zip-compatible archives (zip, jar, apk). It can also compile resources into binary assets.


1 Answers

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!

like image 181
Andrew Quebe Avatar answered Oct 02 '22 01:10

Andrew Quebe