【发布时间】:2013-01-16 09:40:33
【问题描述】:
使用我当前的 android 工具,我能够在 Eclipse 中构建一个 android 项目。当我尝试从命令行使用 ant 构建相同的项目时,它会失败并显示以下输出:
-build-setup:
[echo] Creating output directories if needed...
-pre-build:
-code-gen:
[echo] ----------
[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] Found Deleted Target File
[aapt] Generating resource IDs...
[aapt] invalid resource directory name: /data/project/res/drawable-xxhdpi
BUILD FAILED
/android-sdk-mac_x86/tools/ant/build.xml:485: The following error occurred while executing this line:
/android-sdk-mac_x86/tools/ant/build.xml:560: The following error occurred while executing this line:
/android-sdk-mac_x86/tools/ant/build.xml:589: null returned: 1
据我了解,drawable-xxhdpi 现在是一种受支持的格式,那么为什么它在 Eclipse 中有效但在 ant 中无效?
== 编辑(添加我的 project.properties 文件)== 这是我的 project.properties 文件中的内容:
android.library.reference.1=resources/
android.library.reference.2=../promotion
# Project target.
target=android-8
android.library.reference.3=resources/
android.library.reference.4=resources/
【问题讨论】:
-
我的猜测:您在 ant 脚本中设置了错误的 sdk 目标。尝试 android update project 并给它正确的目标。
-
感谢蒂姆的建议。我已经为项目及其库文件夹运行了 android 更新项目,但无济于事。
-
介意显示你的 project.properties 吗?
-
更新了原始帖子以包含我的 project.properties 文件。