Android的Ant构建失败的xxhdpi文件夹 [英] Android ant build failing on xxhdpi folder

查看:225
本文介绍了Android的Ant构建失败的xxhdpi文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用我目前的Andr​​oid工具,我可以在Eclipse中构建一个Android项目。当我尝试使用蚂蚁从命令行建立在同一个项目时,出现以下的输出:

  -build-设置:
     [回应]如果需要创建输出目录... - pre-编译: - code-创:
     [回应] ----------
     [回应]使用AIDL文件...
     [AIDL]没有AIDL文件进行编译。
     [回应] ----------
     [回应]使用RenderScript文件...
[renderscript]没有RenderScript文件进行编译。
     [回应] ----------
     [回应]处理资源...
     [AAPT]找到删除目标文件
     [AAPT]生成资源ID ...
     [AAPT]无效的资源目录名称:/数据/项目/ RES /绘,xxhdpi构建失败
在执行这条线出现以下错误:/android-sdk-mac_x86/tool​​s/ant/build.xml:485:
在执行这条线出现以下错误:/android-sdk-mac_x86/tool​​s/ant/build.xml:560:
/android-sdk-mac_x86/tool​​s/ant/build.xml:589:空返回:1

这是我的理解是绘制-xxhdpi是支持的格式了,所以为什么在Eclipse这个工作,但不是蚂蚁?

==编辑(添加我的project.properties文件)==
这就是我的project.properties文件中有:

  android.library.reference.1 =资源/
 android.library.reference.2 = .. /促销
 #项目的目标。
 目标=机器人-8
 android.library.reference.3 =资源/
 android.library.reference.4 =资源/


解决方案

您已经于您的Ant脚本/ project.properties设置了错误的目标SDK。 SDK版本为Android 4.2是17,你跟SDK版本8,这是Android的2.2编译

使用此更新您的项目:

Android的更新项目--target 正确目标

您可以列出与 Android的目标列表可用目标

或者更新你的project.properties和手动设置SDK版本(你想编译或任何Android SDK中)17:

 目标= Android的17

Using my current android tools, I am able to build an android project in Eclipse. When I try to build the same project using ant from the commandline, it fails with the following output:

-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

It's my understanding that drawable-xxhdpi is a supported format now, so why is this working in Eclipse but not on ant?

== Edit (Adding my project.properties file) == This is what my project.properties file has in it:

 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/

解决方案

You have set the wrong sdk target in your ant script/project.properties. SDK Version for Android 4.2 is 17, you compile with SDK Version 8, which is Android 2.2.

Use this to update your project:

android update project --target correct target

You can list the available targets with android list targets.

Alternatively just update your project.properties and manually set the SDK version to 17 (or whichever android sdk you want to compile with):

target=android-17

这篇关于Android的Ant构建失败的xxhdpi文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆