I'm getting a VerifyError: Error #1014: Class spark.components::WindowedApplication could not be found. error when running my AIR app from my Ant script. My app uses the extendedDesktop profile (for NativeProcess). I'm using Flash SDK 4.6 and I can compile, run and package the project in Flash Builder 4.6. I'd like to be able to do all of these things with an Ant script.
I'm having the same problem as this question: Compiling AIR application with Ant Task (WindowedApplication could not be found)
My application compiles with the ant script but when I try to run it. I get this error followed by a bunch more not found errors.
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()
some of the other errors:
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.
Here is the compile target of my ant script
<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>
Here is the run target of my ant script
<target name="test" depends="compile">
<exec executable="${ADL}">
<arg value="${APP_DEBUG_DESCRIPTOR}"/>
</exec>
</target>
I've also tried using ADT to package the project as a .dmg and installing it. It installs but immediately exits when I run the installed version. Here is the package target from my ant script.
<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>