Search code examples
androidairjenkinsadt

Jenkins mobile air android packaging error


I've searched google and SO for solutions, but could not find any. I'm developing a mobile AIR app for android, and i use Jenkins as a local CI system. My project compiles fine, however, during the ADT packaging something goes wrong. I've copied the ADT packaging targets from the following examples:

http://blog.terrenceryan.com/using-ant-to-package-the-same-air-app-to-multiple-devices/

and

https://gist.github.com/630170

However, i am getting this output in Jenkins: http://d.pr/i/y2gJ

This is the packaging part in my build.xml file (with important property names and values used):

...
...
<property name="APP_NAME"                   value="Hightide"/>
<property name="ANDROID_HOME"               value="${user.home}/../../../Supermaggel/SDKS/android-sdk-macosx" />
<property name="APP_DESCRIPTOR"             value="${SOURCE_DIR}/${APP_NAME}-app.xml" />
<property name="SWF_FILE"                   value="${APP_NAME}.swf" /> 
<property name="OUTPUT_LOCATION_ANDROID"    location="${BUILD_DIR}/android" />
<property name="OUTPUT_SWF_ANDROID"         location="${OUTPUT_LOCATION_ANDROID}/${SWF_FILE}" />
<property name="OUTPUT_APK_ANDROID"         value="OUTPUT_LOCATION_ANDROID/${APP_NAME}.apk" />
...     
...
<!-- PACKAGE ANDROID -->
<target name="package-android">
    <echo message="Packaging for Android"/>
    <exec executable="${ADT}" dir="${OUTPUT_LOCATION_ANDROID}">
        <arg line="-package"/>
        <arg line="-target apk"/>
        <arg line="-storetype pkcs12"/>
        <arg line="-keystore ${KEYSTORE_ANDROID}" />
        <arg line="-storepass ${STOREPASS_ANDROID}" />
        <arg line="${APP_NAME}"/>                   <!-- output .APK -->
        <arg line="${APP_DESCRIPTOR}"/>         <!-- app descriptor location -->
        <arg line="${OUTPUT_SWF_ANDROID}"/>         <!-- output -->
    </exec>
</target>

I am using Jenkins ver. 1.486, Flash Builder 4.6, AIR 3.3.

Can anyone point out what is going wrong during the packaging? any arguments missing or interpreted wrong?


Solution

  • I found out what caused it. The ADT cli tool gives exit code 2, which means something is wrong with the parameters... i spent hours looking at it, trying to figure out what was wrong. for ADT you need to pass in relative paths, not 'absolute' ones (or, relative from the project root.) so instead of ${PROJECT_ROOT}/packagedir/${APPNAME}.apk just use packagedir/${APPNAME}.apk or something similar, for all paths.