我正在尝试用Ant编译我的AIR应用程序,使用mxmlc Ant Task。它看起来编译得很好,并且我得到了一个类,但是当我尝试用ADL运行它时,我得到了消息“mx.core::WindowedApplication类找不到”。看起来AIR库没有被正确地包含进来。
这是我的mxmlc任务:
<mxmlc
file="${MAIN_MXML}"
output="${DEPLOY_DIR}/MyApp.swf"
compatibility-version="3"
locale="en_US"
static-rsls="true"
debug="${DEBUG_FLAG}"
optimize="true"
link-report="${DEPLOY_DIR}/report.xml"
configname="air">
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml" />
<library-path dir="${FLEX_HOME}/frameworks/libs" append="true">
<include name="*.swc" />
</library-path>
<library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true">
<include name="*.swc" />
</library-path>
<library-path dir="${FLEX_HOME}/frameworks/locale" append="true">
<include name="{locale}" />
</library-path>
<source-path path-element="${SRC_DIR}" />
</mxmlc>你知道为什么会发生这种事吗?我尝试过不包含load-config部分和库路径,但总是相同的结果-它找不到WindowedApplication。
谢谢!
发布于 2010-09-20 07:31:36
我没有尝试用ADL运行,但我用ADL编译和打包它。然后我安装了AIR应用程序,它就可以工作了。
编译
<mxmlc file="${APP_ROOT}/${modulo}.mxml" keep-generated-actionscript="false"
output="${APP_ROOT}/${modulo}.swf"
actionscript-file-encoding="UTF-8"
incremental="false" warnings="false" fork="true" maxmemory="512m" >
<!-- Get default compiler options. -->
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>
<!-- List of path elements that form the roots of ActionScript
class hierarchies. -->
<source-path path-element="${FLEX_HOME}/frameworks"/>
<!-- List of SWC files or directories that contain SWC files. -->
<compiler.library-path dir="${APP_ROOT}" append="true">
<include name="libs" />
</compiler.library-path>
<locale>es_ES</locale>
<!-- Necesario para el source path del Flex Build Paht-->
<compiler.source-path path-element='${APP_ROOT}'/>
<compiler.source-path path-element='${APP_ROOT}/locale/es_ES'/>
<use-network>true</use-network>
<debug>false</debug>
<optimize>true</optimize>
</mxmlc> 包装
<target name="packageModule">
<echo message="Empaquetando ${modulo} como aplicación AIR...." />
<exec dir="${DirectorioBase}" executable="${FLEX_HOME}/bin/adt.bat" spawn="false">
<!--Empaqueta-->
<arg value="-package"/>
<!--Formato del certificado -->
<arg value="-storetype"/>
<arg value="pkcs12"/>
<!--ruta donde está el certificado -->
<arg value="-keystore"/>
<arg value="./certificado/antuan.p12"/>
<!--Password del certificado -->
<arg value="-storepass"/>
<arg value="antuan"/>
<!--Nombre del archivo AIR a generar -->
<arg value="${modulo}.air"/>
<!--nombre del archivo xml de configuración -->
<arg value="${modulo}-app.xml"/>
<!--Nombre del swf compilado -->
<arg value="${modulo}.swf"/>
</exec>https://stackoverflow.com/questions/3241762
复制相似问题