Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ant issue after updating Android SDK tools to revision 14

Tags:

android

ant

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

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>

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(library project):

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

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.

like image 986
mattinergize Avatar asked Feb 23 '23 15:02

mattinergize


1 Answers

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:

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

like image 51
mattinergize Avatar answered Mar 06 '23 09:03

mattinergize