2010-07-06 30 views
1

嘗試使用Ant生成flex4項目時出現錯誤。此代碼的工作,當我沒有導出CustomComponent自定義命名空間(又名:它建立就好了正常) - 但只要我添加了命名空間,包括名稱空間,我得到以下錯誤:僅當包含自定義命名空間時:無法將<mx:LineChart>解析爲組件實現

[compc] CustomComponent.mxml(235): Error: Could not resolve <mx:LineChart> to a component implementation. 
[compc] 
[compc]  <mx:LineChart x="0" y="0" id="lch_fps" width="651" height="45" dataProvider="{perfData}"> 
[compc] 

這是我compc命令塊(我建立一個SWC)

<compc output="${DEPLOY_DIR}/${LIB_TITLE}.swc" include-classes="${classes}" incremental="false" > 
    <define name="CONFIG::Debug" value="${DEBUG}"/> 
    <define name="CONFIG::Release" value="${RELEASE}"/> 
    <source-path path-element="${basedir}/src"/> 
     <namespace uri="http://custom.com/mxml" manifest="${basedir}/src/manifest.xml" /> 
     <include-namespaces>http://custom.com/mxml</include-namespaces> 
    <include-file name="design.xml" path="${basedir}/src/design.xml" /> 
</compc> 

我不能說我曾經遇到這樣的:有什麼建議?

回答

2

原來 - 經過幾天的試驗,錯誤和研究 - 我需要在compc ant任務中定義命名空間。

<namespace uri="http://ns.adobe.com/mxml/2009" manifest="${FLEX_HOME}/frameworks/mxml-2009-manifest.xml" /> 
    <namespace uri="library://ns.adobe.com/flex/spark" manifest="${FLEX_HOME}/frameworks/spark-manifest.xml" /> 
    <namespace uri="library://ns.adobe.com/flex/mx" manifest="${FLEX_HOME}/frameworks/mx-manifest.xml" /> 
    <namespace uri="http://www.adobe.com/2006/mxml" manifest="${FLEX_HOME}/frameworks/mxml-manifest.xml" /> 

不知道爲什麼有可導出的自定義組件需要這個,但它的工作。

相關問題