Question

I'm attempting to compile a Flex application from an ANT script, inside of Eclipse (CFBuilder, based on Eclipse), and I've run into this error:

Could not load definitions from resource flexTasks.tasks. It could not be found.

I haven't been able to find anything that gives directions on where this file (flexTasks.tasks) should be copied to, if it's needed at all. Some places indicate that it should be part of the flexTasks.jar file. I've tried two different things:

  • Copy the jar file into the ant/plugins/lib folder (and restart my CF Builder instance)
  • Specify the path to the jar in the classpath attribute, as suggested by the comment on this page

Neither helps me get past this error.

Here's my build script, for reference:

<project name="Tagging" default="compile-tagging" basedir=".">

    <!-- setup flex compilation capability -->
    <taskdef resource="flexTasks.tasks" />

    <property name="flex.src" value="./src" />
    <property name="flex.bin" value="./bin"/>

    <target name="compile-tagging">
        <mxmlc 
            file="${flex.src}/main.mxml"
            output="${flex.bin}/main.swf" 
            keep-generated-actionscript="true">
                <source-path path-element="${FLEX_HOME}/frameworks" />
        </mxmlc>
    </target>

</project>
Was it helpful?

Solution 2

While not ideal, this code is working for me at the moment:

<project name="IOLTagging" default="go" basedir=".">

    <!-- setup flex compilation capability -->
    <property name="FLEX_HOME" value="C:/program files (x86)/Adobe/Adobe Flash Builder Beta 2/sdks/3.4.1/" />
    <taskdef name="mxmlc" classname="flex.ant.MxmlcTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />
    <taskdef name="html-wrapper" classname="flex.ant.HtmlWrapperTask" classpath="${FLEX_HOME}/ant/lib/flexTasks.jar" />

    <property name="flex.src" value="./src" />
    <property name="flex.bin" value="./bin"/>
    <property name="swf.name" value="main" />

    <target name="go" depends="compile-flex" />

    <target name="compile-flex">
        <mxmlc 
            file="${flex.src}/main.mxml"
            output="${flex.bin}/${swf.name}.swf"
            debug="false" 
            keep-generated-actionscript="false">
                <source-path path-element="${FLEX_HOME}/frameworks" />
                <compiler.library-path dir="${basedir}/libs" append="true">
                    <include name="*.swc" />
                </compiler.library-path>
        </mxmlc>
    </target>
</project>

OTHER TIPS

Adam, I believe you need to tell taskdef where to look for the file. try keeping flextasks.jar in the same directory as your ant file (for now... you can move it later after you get it working).

then, you can do something like this:

<taskdef name="mxmlc" classname="WhateverTheTaskIsNamed" classpath="flexTAsks.jar" />

I had the same problem, and the reason was in lack of permissions to acces $FLEX_HOME/ant.

You can also put the flexTasks.jar in ~/.ant/lib directory

If you run ant -diagnostics you should see the jar in USER_HOME/.ant/lib jar listing

I think you should have solved this problem. just trying flexmonkey today and also got the same problem.

"Could not load definitions from resource flexTasks.tasks. It could not be found." solution is to make sure the flexTasks.jar is included in the dir lib of your project workplace. when I copied flexTasks.jar from flashbuild folder \ant\lib and built it again. the problem is fixed.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top