What's causing this error: “SDK component at air/android/device/Runtime.apk is out of date”

喜夏-厌秋 提交于 2019-12-07 20:37:06

问题


I'm currently working on an Adobe AIR project, for iOS and Android.
We automatically build the thing with Jenkins running an ANT build script. It packages different versions of the application based on different compiles (release and test versions) and the test versions get even more different configs packaged in them.

So far, so good. The build works on my local machine running ANT 1.8.4 combined with the AIR 3.6 SDK.

The problem is, that sometimes, or lately most of the time, on the Jenkins machine (a Mac Mini) the build fails with an error message as seen below:

package-android-versions:
   [delete] Deleting directory /private/var/jenkins/workspace/**********/dist/android/release
    [mkdir] Created dir: /private/var/jenkins/workspace/*************/dist/android/release
     [echo] packaging for android...
     [echo] done
   [delete] Deleting directory /private/var/jenkins/workspace/************/dist/android/test/dummy
    [mkdir] Created dir: /private/var/jenkins/workspace/**************/dist/android/test/dummy
     [echo] packaging for android...
     [java] SDK component at air/android/device/Runtime.apk is out of date

As you may notice, the first package command succeeds so it can't really be that my SDK component is out of date. Then the first package command would have failed too.

Below is the relevant ANT build command:

        <echo>packaging for android...</echo>
        <java jar="${AIR_SDK_HOME}/lib/adt.jar" fork="true" failonerror="true">
            <jvmarg line="-Xmx1024m" />
            <jvmarg line="-XX:MaxPermSize=2048m" />
            <arg line="-package"/>
            <arg line="-target apk-captive-runtime"/>
            <arg line="-storetype pkcs12 -keystore '${dir.portal}/self-signed.p12' -storepass ******"/>
            <arg line="'@{destination}/${app.name}@{label}' '@{source}/${app.descriptor}'" />
            <arg line="-C '@{source}' ."/>
            <arg line="-C '${dir.assets.runtime.android}' ."/>
        </java>
        <echo>done</echo>

I've tried increasing the amount of memory available to the java command (because very often that's a cause of failures in my experience) but that's not the solution here.

Also, I've looked at the answer to this similar question but our build machine doesn't go get coffee between compiling and packaging, so that can't be the real answer ;)

Any other ideas?


回答1:


I did some investigation: adt.jar is launching a separate process to get the Android version info from Runtime.apk using lib/android/bin/aapt. It looks like the invocation of this separate process and/or the reading of its output could be the culprit here.

Without actually getting the source for adt.jar in a compilable version and adding extra debug info I can't be certain this is the issue, but it looks a lot like it. Triggers for errors could be anything on the machine that influences threads or file-reading, which is basically any system activity.

The adt.jar in AIR SDK 3.8 includes a small change in the area where the external process is launched to make sure the output of the aapt command is fully read.

Upgrading to 3.8 will probably fix the issue, and without modification of adt.jar the 3.6 version cannot be fixed.

PS: Ha Frank! :-)



来源:https://stackoverflow.com/questions/17492157/whats-causing-this-error-sdk-component-at-air-android-device-runtime-apk-is-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!