2012-08-16 57 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組件。

相關問題