我在尝试使用Ant构建flex4项目时遇到错误。当我没有用于导出CustomComponent的自定义命名空间(也就是:它正常构建)时,此代码可以正常工作-但只要我添加命名空间和包含命名空间,我就会收到以下错误:
[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>我不能说我曾经遇到过这样的情况:有什么建议吗?
发布于 2010-07-08 15:09:59
经过几天的试验、错误和研究,我发现我需要在compc任务中定义名称空间。
<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" />我不确定为什么有可导出的自定义组件需要这样做,但它是有效的。
https://stackoverflow.com/questions/3183447
复制相似问题