Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
将Android SDK工具更新至第14版后的Ant问题_Android_Ant - Fatal编程技术网

将Android SDK工具更新至第14版后的Ant问题

将Android SDK工具更新至第14版后的Ant问题,android,ant,Android,Ant,在安装Android SDK工具修订版14(执行ant-version时为ant版本1.8.2)以在Android 4.0(ICS)上安装和测试我们的应用程序之后,我注意到我们的自动构建脚本现在失败了。构建脚本正在执行一个ant命令来构建apk,该命令在修订更新后抱怨build.xml文件过时,并执行ant更新项目-p来修复此问题。我们的项目有一个顶级项目和两个它引用的库项目,都是用IntelliJ开发的。删除旧build.xml文件后,我在每个项目文件夹中运行了updateproject命令。

在安装Android SDK工具修订版14(执行ant-version时为ant版本1.8.2)以在Android 4.0(ICS)上安装和测试我们的应用程序之后,我注意到我们的自动构建脚本现在失败了。构建脚本正在执行一个ant命令来构建apk,该命令在修订更新后抱怨build.xml文件过时,并执行ant更新项目-p来修复此问题。我们的项目有一个顶级项目和两个它引用的库项目,都是用IntelliJ开发的。删除旧build.xml文件后,我在每个项目文件夹中运行了updateproject命令。现在我得到了以下信息:

<SDK_DIR>/tools/ant/build.xml:466: The following error occurred while executing this line:
<SDK_DIR>/tools/ant/build.xml:539: The following error occurred while executing this line:
<SDK_DIR>/tools/ant/build.xml:568: null returned: 1
公共图书馆项目:

facebook(图书馆项目):


正在寻找一种方法来找出错误消息中的行号和/或运行此程序时出现的问题。我还有一个build.properties文件,它包含在AppMain build.xml文件中,用于指定用于创建签名apk的key.store key.alias值,我假设在解决此问题后可以将其添加回build.xml

我发布的错误相当模糊。再深入一点,我发现有一种方法可以指定Ant日志文件。我这样做了,发现它在编译时爆炸了。事实证明,新编译器不喜欢generate R类中的几个资源名称是相同的。我重新命名了那些冲突的代码,在经历了更多的编译问题(带有R.id.的case语句在这个编译器版本中显然是一个no-no)之后,我能够让它正常工作。Ant日志文件无疑是调试此问题的方法。以下是我在发出ant release命令时用来生成日志文件的内容:


ant-logfile//antLogFile.txt release-f./AppMain/build.xml

在我的例子中,发生此错误只是因为我的一个资源的文件名中有一个大写字母。我重命名了资源及其引用,错误消失了

<?xml version="1.0" encoding="UTF-8"?>
<project name="LaunchActivity" default="help">
    <loadproperties srcFile="local.properties" />
    <property file="ant.properties" />
    <loadproperties srcFile="project.properties" />
    <fail 
        message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
        unless="sdk.dir"
/>
    <import file="${sdk.dir}/tools/ant/build.xml" />
</project>
android.library.reference.1=../Common
android.library.reference.2=../facebook
# Project target.
target=Google Inc.:Google APIs:8
android.library=true
# Project target.
target=Google Inc.:Google APIs:8
android.library=true
# Project target.
target=Google Inc.:Google APIs:8