2012-08-16 248 views
1

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

如果我只是复制Flash Builder构建的.swf文件,它会运行,所以我认为问题与编译方式有关。 – Reid 2012-08-16 20:10:16

回答

1

我改变了外部库路径仅包括airglobal.swc和这让我过去的这个错误。

<compiler.external-library-path dir="${FLEX_HOME}/frameworks/libs/air" append="true"> 
    <include name="airglobal.swc" /> 
</compiler.external-library-path> 

我认为包括作为外部库是造成从连接省略了一堆的名为.swc整个空气文件夹。

0

我在FlashDevelop中遇到了一个类似的问题,那里的应用程序编译正常,但在运行时出现“错误1014:未找到spark组件应用程序”。

有关更改外部库路径的答案帮助我找出问题所在。基本上,我删除路径从项目选项 - >标签编译器选项,只剩下:

Intrinsic Libraries: Library\AS3\frameworks\Flex4 

和SWC库里面我离开我使用其他任何第三方库。还有一个FLVPlayback.swc(在Flash CS中编译),用于在AS3代码中使用FLVPlayback。通过这种方式,我可以在正常的AS3应用程序中使用这个Flex/Spark组件。

相关问题