开发者

only when including custom namespace: Could not resolve <mx:LineChart> to a component implementation

I'm getting an error when trying to build a flex4 project with Ant. This code works when i don't have a custom namespace for exporting CustomComponent (aka: it builds just fine normally) - but as soon as i add the namespace and include-namespaces, i get the following error:

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

This is my compc block (i'm building a 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-na开发者_如何学Gomespaces>http://custom.com/mxml</include-namespaces>
    <include-file name="design.xml" path="${basedir}/src/design.xml" />
</compc>

I can't say i've ever run into this: any suggestions?


Turns out - after several days of trial, error, and research - that i needed to define the namespaces in the compc ant task.

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

Not sure why having exportable custom components requires this, but it worked.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜