Reputation: 608
Extending my previous question Aapt is not working correctly - cannot generate R IDs on fresh project
I installed fresh Ubuntu Server 12.04 on 32bit machine, after that I downloaded Android SDK and upadted. Then I created new project from command line:
gyver@Gyver:~/tmp$ android create project
-t android-17 -p test -k com.example.test -a HomeActivity
No problems at this point. Then I tried to use Ant to compile:
gyver@Gyver:~/tmp/test$ ant clean debug install
Buildfile: /home/gyver/tmp/test/build.xml
-check-env:
[checkenv] Android SDK Tools Revision 22.0.5
[checkenv] Installed at /opt/android-sdk
-setup:
[echo] Project Name: HomeActivity
[gettype] Project Type: Application
-pre-clean:
clean:
[delete] Deleting directory /home/gyver/tmp/test/bin
[getlibpath] Library dependencies:
[getlibpath] No Libraries
[subant] No sub-builds to iterate on
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.0.5
[checkenv] Installed at /opt/android-sdk
-setup:
[echo] Project Name: HomeActivity
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 18.0.1
[echo] Resolving Build Target for HomeActivity...
[gettarget] Project Target: Android 4.2.2
[gettarget] API level: 17
[gettarget] WARNING: No minSdkVersion value set. Application will install on all Android versions.
[echo] ----------
[echo] Creating output directories if needed...
[mkdir] Created dir: /home/gyver/tmp/test/bin
[mkdir] Created dir: /home/gyver/tmp/test/bin/res
[mkdir] Created dir: /home/gyver/tmp/test/gen
[mkdir] Created dir: /home/gyver/tmp/test/bin/classes
[mkdir] Created dir: /home/gyver/tmp/test/bin/dexedLibs
[echo] ----------
[echo] Resolving Dependencies for HomeActivity...
[dependency] Ordered libraries:
[echo] ----------
[echo] Building Libraries with 'debug'...
[subant] No sub-builds to iterate on
-code-gen:
[mergemanifest] Merging AndroidManifest files into one.
[mergemanifest] Manifest merger disabled. Using project manifest only.
[echo] Handling aidl files...
[aidl] No AIDL files to compile.
[echo] ----------
[echo] Handling RenderScript files...
[renderscript] No RenderScript files to compile.
[echo] ----------
[echo] Handling Resources...
[aapt] Generating resource IDs...
BUILD FAILED
/opt/android-sdk/tools/ant/build.xml:649: The following error occurred while executing this line:
/opt/android-sdk/tools/ant/build.xml:690: null returned: 132
Total time: 3 seconds
gyver@Gyver:~/tmp/test$
An error, at this point it is not clear what's wrong. I looked into build.xml to find out that Ant is calling aapt
, so I tried start it directly
/opt/android-sdk/build-tools/18.0.1/aapt package -f -m
-M /home/gyver/tmp/test/bin/AndroidManifest.xml
-S /home/gyver/tmp/test/bin/res
-S /home/gyver/tmp/test/res
-I /opt/android-sdk/platforms/android-17/android.jar
-J /home/gyver/tmp/test/gen --generate-dependencies
-G /home/gyver/tmp/test/bin/proguard.txt
With result
Illegal instruction (core dumped)
It there a way to fix it ? Aapt seems fine on 64bit machines, this 32bit server is the only case I cannot build a project
Upvotes: 2
Views: 1631
Reputation: 157
I can confirm this bug in aapt remains in version 19.0.3 of android build tools. I have two machines running latest Android SDK and NDK. I am using ANT. My projects build successfully in both debug and release mode on my laptops, but aapt fails with only message "illegal instruction" on desktop development box, unless I use the suggestion here. Specifically, I copied the version 17.0.0 binary of aapt, into the directory for build tools 19.0.3. This is an ugly hack, but I can now build projects successfully on my desktop box. So, if you want to run latest build tools (19.0.3) on 32-bit Pentium uniprocessor, you can downgrade the 19.0.3 aapt to 17.0.0 aapt, and you can build projects.
Specifically: aapt (all versions) work on my ACER Travelmate 6460, a 32-bit dual processor, running Intel Core2 cpu, T2700, running 2 ghz, with Phoenix BIOS version 1.09.
The ver. 17 aapt works, but vers. 18 and 19, fail with message "illegal instruction", on my 32-bit Asus box, an Intel Pentium 4, running 2400 mhz, Award Bios rev. 1004. Total memory is 1.3 gigabytes.
Some error reports suggested memory constraint or bad .png files are cause, but this is not the case. Looks like some unwise fellow just removed 32-bit uniprocessor code from recent builds of aapt, thus breaking aapt for 32-bit Intel boxes running Linux.
Both platforms are running Fedora Linux, kernel version 2-6.25-14.fc9.i686, with Gnome desktop. Both platforms run the latest Android tools, and the device emulator, adb, ant, and the latest SDK and NDK, supporting builds to Android 4.4.2 level devices.
Upvotes: 0
Reputation: 330
I have the same problems with the rev. 18.0.1 aapt. I think it is a bug and opened a bug report under http://code.google.com/p/android/issues/detail?id=58663
The rev. 17 aapt works for me, so it might be a temporary solution to use the rev. 17 Build-tools.
Upvotes: 2