2010-07-13 5 views
1

Je tente de compiler mon application AIR avec Ant, en utilisant la tâche Ant mxmlc. Il semble bien se compiler, et je reçois un fichier .swf, mais quand j'essaie de le lancer avec ADL, je reçois le message "Class mx.core :: WindowedApplication est introuvable". Il semble que les bibliothèques AIR ne sont pas correctement incluses.Compilation de l'application AIR avec la tâche Ant (WindowedApplication est introuvable)

Voilà ma tâche 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> 

Toute idée pourquoi cela se passe? J'ai essayé de ne pas inclure la section load-config et de ne pas inclure les chemins de bibliothèque, mais c'est toujours le même résultat - il ne trouve pas WindowedApplication.

Merci!

Répondre

1

Je n'essaie pas d'exécuter avec ADL, mais je compile et le package avec ADL. Ensuite, j'installe l'application AIR et ça marche.

Compilation

<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>   

Emballage

<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> 
Questions connexes