扩展我之前的问题Aapt 无法正常工作 - 无法在新项目上生成 R ID
我在 32 位机器上安装了新的 Ubuntu Server 12.04,之后我下载了 Android SDK 并更新了。然后我从命令行创建了新项目:
gyver@Gyver:~/tmp$ android create project
-t android-17 -p test -k com.example.test -a HomeActivity
在这一点上没有问题。然后我尝试用Ant编译:
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$
一个错误,目前还不清楚是什么问题。我查看了 build.xml 发现 Ant 正在调用aapt
,所以我尝试直接启动它
/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
结果
Illegal instruction (core dumped)
有办法解决吗?Aapt 在 64 位机器上似乎很好,这个 32 位服务器是我无法构建项目的唯一情况