2010-11-01 43 views
1

我试图使用ant编译组件,并在整个组件中不断收到此错误消息。 。 。错误“无法解决<s:SolidColorStroke>”当试图用Ant编译Flex 4 SWC

ButtonSkin.mxml(179): Error: Could not resolve <s:SolidColorStroke> to a component implementation. 
ButtonSkin.mxml(210): Error: Could not resolve <s:GradientEntry> to a component implementation. 

它编译于4 FlashBuilder罚款这里是build.xml文件的内容:

<project name="Flex Ant Tasks Build Script" default="compile flex project"> 
    <property name="FLEX_HOME" value="c:/build/flex_sdk" /> 
    <property name="SDK_VERSION" value="4.1.0.16076" /> 
    <taskdef resource="flexTasks.tasks" classpath="c:/build/flex_sdk/lib/flexTasks.jar"/> 
    <echo message="File: ${FLEX_HOME}"/> 
    <!-- Build and output the Main.swf--> 
    <target name="compile flex project"> 
    <compc output="${basedir}/../FlexSI/libs/MyLibrary.swc" locale="en_US"> 
<load-config filename="${FLEX_HOME}/frameworks/flex-config.xml" />   
     <source-path path-element="${basedir}/src"/> 
     <include-sources dir="${basedir}/src" includes="*" /> 
     <library-path dir="${basedir}/libs" includes="*" append="true"/> 
     <namespace uri="http://testapp.com/siLibrary" manifest="${basedir}/src/xml/manifest.xml" /> 
    </compc> 
    </target> 
</project> 

回答

1

SolidColorStroke不属于Spark主题。尝试使用mx:SolidColorStroke而不是s:SolidColorStroke。与GradientEntry一样。

1

forums.adobe.com讨论相关问题。

建议的解决方法或解决方案是明确指定所有Spark(Flex4)和Halo(Flex3)相关的类名称空间,例如,

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