导致此错误的原因:“air/android/device/Runtime.apk 上的 SDK 组件已过期" [英] What's causing this error: "SDK component at air/android/device/Runtime.apk is out of date"

查看:40
本文介绍了导致此错误的原因:“air/android/device/Runtime.apk 上的 SDK 组件已过期"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发适用于 iOS 和 Android 的 Adob​​e AIR 项目.
我们使用运行 ANT 构建脚本的 Jenkins 自动构建事物.它根据不同的编译(发布和测试版本)打包不同版本的应用程序,并且测试版本中打包了更多不同的配置.

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.

到目前为止,一切都很好.该构建在运行 ANT 1.8.4 和 AIR 3.6 SDK 的本地机器上运行.

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

问题是,有时,或最近大部分时间,在 Jenkins 机器上(Mac Mini)构建失败并显示如下错误消息:

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

您可能已经注意到,第一个 package 命令成功了,所以我的 SDK 组件不可能真的过时了.那么第一个 package 命令也会失败.

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.

以下是相关的 ANT 构建命令:

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>

我已尝试增加 java 命令可用的内存量(因为在我的经验中,这通常是导致失败的原因),但这不是这里的解决方案.

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 ;)

还有其他想法吗?

推荐答案

我做了一些调查:adt.jar 正在启动一个单独的进程,以使用 lib/android/bin/aapt 从 Runtime.apk 获取 Android 版本信息.看起来这个单独进程的调用和/或其输出的读取可能是这里的罪魁祸首.

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.

如果没有在可编译版本中实际获取 adt.jar 的源代码并添加额外的调试信息,我无法确定这是问题所在,但它看起来很像.错误触发器可以是机器上影响线程或文件读取的任何东西,这基本上是任何系统活动.

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.

AIR SDK 3.8 中的 adt.jar 在启动外部进程的区域中包含一个小的更改,以确保完全读取 aapt 命令的输出.

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.

升级到 3.8 可能会解决这个问题,如果不修改 adt.jar,3.6 版本将无法修复.

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

PS:哈弗兰克!:-)

PS: Ha Frank! :-)

这篇关于导致此错误的原因:“air/android/device/Runtime.apk 上的 SDK 组件已过期"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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