title: Runtime error after compiling AIR application with ant script
body: <p>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. </p>
  
  <p>I'm having the same problem as this question:
  <a href="https://stackoverflow.com/questions/3241762/compiling-air-application-with-ant-task-windowedapplication-could-not-be-found">Compiling AIR application with Ant Task (WindowedApplication could not be found)</a></p>
  
  <p>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. </p>
  
  <blockquote>
    <p>VerifyError: Error #1014: Class spark.components::WindowedApplication could not be found.</p>
    
    <p>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()</p>
  </blockquote>
  
  <p>some of the other errors:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>Here is the compile target of my ant script</p>
  
  <pre><code>&lt;target name="compile" depends="init"&gt;
    &lt;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"&gt;
      &lt;locale&gt;en_US&lt;/locale&gt;
      &lt;static-link-runtime-shared-libraries&gt;true&lt;/static-link-runtime-shared-libraries&gt;
  
      &lt;load-config filename="${FLEX_HOME}/frameworks/air-config.xml"/&gt;
      &lt;source-path path-element="${APP_ROOT}/src"/&gt;
      &lt;source-path path-element="${FLEX_HOME}/frameworks"/&gt;
      &lt;source-path path-element="${APP_ROOT}/../MyLib/src"/&gt;
  
      &lt;compiler.external-library-path dir="${FLEX_HOME}/frameworks" append="true"&gt;
          &lt;include name="libs/air" /&gt;
          &lt;/compiler.external-library-path&gt;
  
      &lt;compiler.library-path dir="${FLEX_HOME}/frameworks" append="true"&gt;
                      &lt;include name="libs" /&gt;
              &lt;include name="libs/mx" /&gt;
              &lt;include name="libs/air" /&gt;
                      &lt;include name="locale/{locale}" /&gt;
                  &lt;/compiler.library-path&gt;
      &lt;compiler.library-path dir="${APP_ROOT}" append="true"&gt;
                      &lt;include name="libs" /&gt;
                      &lt;include name="libs/player" /&gt;
                  &lt;/compiler.library-path&gt; 
      &lt;define name="CONFIG::debugging" value="false"/&gt;
  
       &lt;compiler.debug&gt;true&lt;/compiler.debug&gt;             
    &lt;/mxmlc&gt;
    &lt;copy filtering="true" file="${APP_DESCRIPTOR}" tofile="${APP_DEBUG_DESCRIPTOR}" /&gt;
          &lt;replace file="${APP_DEBUG_DESCRIPTOR}"&gt;
              &lt;replacefilter token="[This value will be overwritten by Flash Builder in the output app.xml]" value="${APP_NAME}.swf"/&gt;
          &lt;/replace&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>Here is the run target of my ant script</p>
  
  <pre><code>&lt;target name="test" depends="compile"&gt;
      &lt;exec executable="${ADL}"&gt;
          &lt;arg value="${APP_DEBUG_DESCRIPTOR}"/&gt;
      &lt;/exec&gt; 
  &lt;/target&gt;
  </code></pre>
  
  <p>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.</p>
  
  <pre><code>&lt;target name="package" &gt;
      &lt;java jar="${ADT.JAR}" fork="true" failonerror="true"&gt;
          &lt;arg value="-package"/&gt;
          &lt;arg value="-storetype"/&gt;
          &lt;arg value="${STORETYPE}"/&gt;
          &lt;arg value="-keystore"/&gt;
          &lt;arg value="${KEYSTORE}"/&gt;
          &lt;arg value="-storepass"/&gt;
          &lt;arg value="${KEYSTORE_PASS}"/&gt;
          &lt;!-- Target --&gt;
          &lt;arg value="-target"/&gt;
          &lt;arg value="native"/&gt;
          &lt;!-- Output --&gt;
          &lt;arg value="${PACKAGE_NAME}"/&gt;
          &lt;!-- App XML --&gt;
          &lt;arg value="${APP_DEBUG_DESCRIPTOR}"/&gt;
          &lt;!-- Include all files from the bin directory --&gt;
          &lt;arg value="-C"/&gt;
          &lt;arg value="${DEBUG_DIR}"/&gt;
          &lt;arg value="${APP_NAME}.swf"/&gt;
          &lt;arg value="-C"/&gt;
          &lt;arg value="src"/&gt;
          &lt;arg value="images"/&gt;
          &lt;arg value="-C"/&gt;
          &lt;arg value="src"/&gt;
          &lt;arg value="process"/&gt;
          &lt;arg value="-C"/&gt;
          &lt;arg value="src"/&gt;
          &lt;arg value="assets"/&gt;
          &lt;arg value="-C"/&gt;
          &lt;arg value="src"/&gt;
          &lt;arg value="styles"/&gt;
      &lt;/java&gt;
      &lt;echo message="Finished packaging ${PACKAGE_NAME}"/&gt;
  &lt;/target&gt;
  </code></pre>