apache-flexflex4compc

Error "Could not resolve <s:SolidColorStroke>" When Trying to Compile a Flex 4 SWC with Ant


I'm trying to compile a component using ant and keep getting this error message throughout the component . . .

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.

It compiles fine in FlashBuilder 4. Here is the contents of the 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>

Solution

  • SolidColorStroke doesn't belong to Spark theme. Try to use mx:SolidColorStroke instead of s:SolidColorStroke. Same with GradientEntry.