更新Android SDK工具修订后14蚂蚁问题 [英] Ant issue after updating Android SDK tools to revision 14

查看:136
本文介绍了更新Android SDK工具修订后14蚂蚁问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

After installing Android SDK tools revision 14(ant version 1.8.2 when doing ant -version) to install and test our apps on Android 4.0(ICS), I've noticed that our automatic build script is now failing. The build script is executing an ant command to build the apk, which after the revision update complained about the build.xml file being out of date and to execute the ant update project -p to fix this. Our project has a top level project and two library projects it references, all developed in IntelliJ. I ran the update project command in each project folder after deleting out the old build.xml file. Now I'm getting the following message:

<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

我已经包括了code为主营项目和库项目下面的build.xml文件(同一个):

I've included the code for the main project and library projects build.xml file below(same for each):

<?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>

随着新的project.properties文件(如下图):
AppMain(非库项目):

With the new project.properties files(below): AppMain(non-library project):

android.library.reference.1=../Common
android.library.reference.2=../facebook
# Project target.
target=Google Inc.:Google APIs:8

通用(库项目):

Common(library project):

android.library=true
# Project target.
target=Google Inc.:Google APIs:8

Facebook的(库项目):

facebook(library project):

android.library=true
# Project target.
target=Google Inc.:Google APIs:8

寻找一个办法,找出在错误信息和/或得到这个运行问题的行号什么的。我也有,我已经包含在AppMain build.xml文件一个build.properties文件,以创建一个签名的apk,这我假设我可以到build.xml文件后重新添加指定key.store key.alias值这个问题解决了。

Looking for a way to find out what's at the line number in the error message and/or the issue in getting this to run. I also have a build.properties file that I had included in the AppMain build.xml file to specify key.store key.alias values for creating a signed apk, which I'm assuming I can add back in to the build.xml after this issue is resolved.

推荐答案

我张贴的错误是pretty模糊。所以在挖多一点,我发现有指定的Ant日志文件的方式。我这样做,并发现它是在编译炸毁。原来,新的编译器不喜欢,在产生R个班的几个资源名称是相同的。我改名是相冲突的人,并通过一对夫妇更编译问题涉水后(与R.id. case语句是一个没有没有在这个编译器的版本显然)我能得到这个工作。蚂蚁日志文件肯定是去调试这个问题的方式。下面是我用来生成一个日志文件,同时发出蚂蚁发布命令:

The error I posted was pretty vague. So digging in a bit more, I discovered there was a way to specify an Ant logFile. I did this and found out that it was blowing up on compile. Turns out the new compiler didnt like that a few resource names in the generate R classes were the same. I renamed the ones that conflicted and after wading through a couple more compilation issues(case statements with R.id. was a no-no in this compiler version apparently) I was able to get this to work. The Ant LogFile was definitely the way to go to debug this issue. The following is what I used to generate a logFile while issuing the ant release command:

蚂蚁-logfile //antLogFile.txt发布-f ./AppMain/build.xml

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

这篇关于更新Android SDK工具修订后14蚂蚁问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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