我收到VerifyError错误#1014:无法找到类spark.components :: WindowedApplication。从我的Ant脚本运行AIR应用程序时出错。 我的应用程序使用extendedDesktop配置文件(用于NativeProcess)。我使用的是Flash SDK 4.6,我可以在Flash Builder 4.6中编译,运行和打包项目。我希望能够用Ant脚本完成所有这些工作。使用ant脚本编译AIR应用程序后发生运行时错误
我有同样的问题,因为这个问题: Compiling AIR application with Ant Task (WindowedApplication could not be found)
我的应用程序编译与Ant脚本,但是当我尝试运行它。我得到这个错误,然后是一堆更多未找到的错误。
VerifyError: Error #1014: Class spark.components::WindowedApplication could not be found.
at flash.display::MovieClip/nextFrame() at mx.managers::SystemManager/deferredNextFrame()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:278] at mx.managers::SystemManager/preloader_preloaderDocFrameReadyHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\managers\SystemManager.as:2627] at flash.events::EventDispatcher/dispatchEventFunction() at flash.events::EventDispatcher/dispatchEvent() at mx.preloaders::Preloader/timerHandler()[E:\dev\4.y\frameworks\projects\framework\src\mx\preloaders\Preloader.as:515] at flash.utils::Timer/_timerDispatch() at flash.utils::Timer/tick()
其他一些错误:
VerifyError: Error #1014: Class IFlexAsset could not be found. VerifyError: Error #1014: Class mx.core::FontAsset could not be found. VerifyError: Error #1014: Class mx.core::SpriteAsset could not be found. VerifyError: Error #1014: Class mx.core::BitmapAsset could not be found.
这里是我的Ant脚本
<target name="compile" depends="init">
<mxmlc file="${MAIN_SOURCE_FILE}"
output="${DEBUG_DIR}/${APP_NAME}.swf"
services="${APP_ROOT}/services/flex/services-config.xml"
configname="air"
actionscript-file-encoding="UTF-8" fork="true">
<locale>en_US</locale>
<static-link-runtime-shared-libraries>true</static-link-runtime-shared-libraries>
<load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/>
<source-path path-element="${APP_ROOT}/src"/>
<source-path path-element="${FLEX_HOME}/frameworks"/>
<source-path path-element="${APP_ROOT}/../MyLib/src"/>
<compiler.external-library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs/air" />
</compiler.external-library-path>
<compiler.library-path dir="${FLEX_HOME}/frameworks" append="true">
<include name="libs" />
<include name="libs/mx" />
<include name="libs/air" />
<include name="locale/{locale}" />
</compiler.library-path>
<compiler.library-path dir="${APP_ROOT}" append="true">
<include name="libs" />
<include name="libs/player" />
</compiler.library-path>
<define name="CONFIG::debugging" value="false"/>
<compiler.debug>true</compiler.debug>
</mxmlc>
<copy filtering="true" file="${APP_DESCRIPTOR}" tofile="${APP_DEBUG_DESCRIPTOR}" />
<replace file="${APP_DEBUG_DESCRIPTOR}">
<replacefilter token="[This value will be overwritten by Flash Builder in the output app.xml]" value="${APP_NAME}.swf"/>
</replace>
</target>
这里的compile目标是我的ant脚本的运行目标
<target name="test" depends="compile">
<exec executable="${ADL}">
<arg value="${APP_DEBUG_DESCRIPTOR}"/>
</exec>
</target>
我也试过使用ADT来封装t他投影为.dmg并安装它。它会安装,但在运行安装的版本时立即退出。 这是我的ant脚本中的包目标。
<target name="package" >
<java jar="${ADT.JAR}" fork="true" failonerror="true">
<arg value="-package"/>
<arg value="-storetype"/>
<arg value="${STORETYPE}"/>
<arg value="-keystore"/>
<arg value="${KEYSTORE}"/>
<arg value="-storepass"/>
<arg value="${KEYSTORE_PASS}"/>
<!-- Target -->
<arg value="-target"/>
<arg value="native"/>
<!-- Output -->
<arg value="${PACKAGE_NAME}"/>
<!-- App XML -->
<arg value="${APP_DEBUG_DESCRIPTOR}"/>
<!-- Include all files from the bin directory -->
<arg value="-C"/>
<arg value="${DEBUG_DIR}"/>
<arg value="${APP_NAME}.swf"/>
<arg value="-C"/>
<arg value="src"/>
<arg value="images"/>
<arg value="-C"/>
<arg value="src"/>
<arg value="process"/>
<arg value="-C"/>
<arg value="src"/>
<arg value="assets"/>
<arg value="-C"/>
<arg value="src"/>
<arg value="styles"/>
</java>
<echo message="Finished packaging ${PACKAGE_NAME}"/>
</target>
如果我只是复制Flash Builder构建的.swf文件,它会运行,所以我认为问题与编译方式有关。 – Reid 2012-08-16 20:10:16