我收到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