2011-05-26 74 views
4

我想從我已經writen源編譯SWC,但由於某種原因,我得到這個錯誤:Ant任務使用compc空氣錯誤

[compc] Error: 'flash.events:StageOrientationEvent' is undefined. 
[compc] 
[compc] Error: 'flash.data:EncryptedLocalStore' is undefined. 
[compc] 
[compc] Error: 'flash.desktop:NativeDragActions' is undefined. 
[compc] 
[compc] Error: 'flash.desktop:NativeDragOptions' is undefined. 
[compc] 
[compc] Error: 'flash.events:NativeDragEvent' is undefined. 

,並不能找出如何解決它。

任何想法?

UPDATE

t工廠compc命令代碼:

<compc debug="true" target-player="10.2" optimize="true" strict="true" as3="true" compute-digest="false" output="${outputFull}"> 
    <include-sources dir="./" includes="**/*.as" /> 
<compiler.library-path dir="${FLEX_HOME}/frameworks/libs" append="true"> 
     <include name="*"/> 
</compiler.library-path> 
</compc> 
+2

請添加文本錯誤你的問題,而不是發佈一個鏈接到外部資源。 乾杯 – 2011-05-26 14:37:14

+0

空氣和Flex的版本?似乎你正試圖編譯一個移動項目,也有與此相關的警告。 – dain 2011-05-26 15:12:27

+0

我使用的是flex_sdk_4.5.0.19786,而Target是10.2,這個swc是桌面應用程序的一部分。 everyhing很好,直到我加入了'EncryptedLocalStore'功能 – 2011-05-26 15:20:46

回答

7

好了,一些谷歌福後,我發現通過compc 不會對空氣組件庫工作!

得到這個,你需要使用acompc!是的!檢查了這一點:http://livedocs.adobe.com/flex/3/html/help.html?content=CommandLineTools_3.html

我從來沒有聽說過,要麼,和谷歌acompc並沒有真正給你多少。

我無法找到一個Ant任務的任何文件,但我發現這個博客帖子描述瞭如何用「EXEC任務」做到這一點,這個build.xml在這篇博客的評論:http://andkrup.wordpress.com/2010/06/08/flex-3-5-air-swc-ant-tasks/

更新 我重新閱讀該博客文章,並在此代碼被張貼在最後評論發現箱底有:

<compc output="${dir.build}/${ant.project.name}.swc" target-player="10.0.0"> 
    <load-config filename="${FLEX_HOME}/frameworks/air-config.xml" /> 
</compc> 

顯然compc命令只需要一個不同的config.xml中正確運行。

+0

很適合我。感謝名單。 – 2011-07-07 07:55:10

+1

您需要添加到''的同一行來編譯swf。 – 2011-07-07 09:25:03

+0

謝謝!一直在撓我的頭幾個小時,直到我發現這:) – triad 2012-03-08 23:34:35