5 Replies Latest reply on Oct 7, 2010 5:22 AM by Dhruv C

    About Flex ANT Task Bug..


      HI, All

      I'm new user in flex.


      I have a question about flex ant mxmlc task.

      I developing a flex application.

      This is a pretty big project. output file size is about 1.8MB.


      if I compile in flex builder, the compiler work well. but if I compile in ant.. the ant goes die. Just die no error messages.


      this is a code part of my build.xml

      <mxmlc file="${flex_src}/asm.mxml" output="${build}/asm.swf" incremental="true" services="WebContent\WEB-INF\flex\services-config.xml" context-root="asm">
         <load-config filename="${FLEX_FRAMEWORK}/flex-config.xml" />
         <source-path path-element="${FLEX_FRAMEWORK}" />

         <runtime-shared-library-path path-element="${FLEX_FRAMEWORK}/libs/datavisualization.swc">
          <url rsl-url="datavisualization_3.2.0.3958.swf" />
          <url rsl-url="datavisualization_3.2.0.3958.swz" />
         <runtime-shared-library-path path-element="${FLEX_FRAMEWORK}/libs/rpc.swc">
          <url rsl-url="rpc_3.2.0.3958.swf" />
          <url rsl-url="rpc_3.2.0.3958.swz" />


      This is a ant output when I set -debug options

      "+flexlib=C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.2.0/frameworks"
      "-load-config=C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.2.0/frameworks/flex-config.xml"
      "-compiler.source-path=C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.2.0/frameworks"
      -runtime-shared-library-path "C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.2.0/frameworks/libs/framework.swc" framework_3.2.0.3958.swf framework_3.2.0.3958.swz
      -runtime-shared-library-path "C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.2.0/frameworks/libs/datavisualization.swc" datavisualization_3.2.0.3958.swf datavisualization_3.2.0.3958.swz
      -runtime-shared-library-path "C:\Program Files\Adobe\Flex Builder 3 Plug-in\sdks\3.2.0/frameworks/libs/rpc.swc" rpc_3.2.0.3958.swf rpc_3.2.0.3958.swz -output=D:\Workspace\asm\build\asm.swf -- D:\Workspace\asm\flex_src/asm.mxml


      when I make temporary mxml file and compile using uppon code... the ant work well..

      Do you know why the ant goes die??


      And Do you know how I get flex all compile option text in flex builder??

        • 1. Re: About Flex ANT Task Bug..
          jake_flex Level 2

          The ant documentation says that you should always use '/' as a directory separator, even on Windows platform. I see you are mixing forward and backward slashes in your build script. Fix this and see if it help.


          Propably not related to this issue, but I believe you should define the context-root as '/asm'.

          • 2. Re: About Flex ANT Task Bug..
            reiwee Level 1

            I change seperator and I try again, but my ant project have a same problem yet.


            Anyway my build file has three mxmlc build task.

            other mxmlc has work well.  only the one has problem.


            other mxml file is small size. these output file size is about 500kb. but the problem mxml output file size is 1.8mb...


            It seems that the ant was occured memory overflow.

            But generally when ant needs more memory, ant notify heap space exception, but in my case, ant just goes die.


            thank you for reply.

            • 3. Re: About Flex ANT Task Bug..
              Anthony T DeBonis Level 1

              Try adding this to you mxmc tag


              fork="true" maxmemory="256m"




              Try the setting on this page - works for me


              http://www.themorphicgroup.com/blog/2009/07/10/compiling-using-ant-in-flex-builder-error-j ava-heap-space/

              • 4. Re: About Flex ANT Task Bug..
                reiwee Level 1

                Thank you for reply.


                I try to add the tag, but ant notify the error.


                [mxmlc] java.lang.NoClassDefFoundError: flex2/tools/Compiler
                    [mxmlc] Caused by: java.lang.ClassNotFoundException: flex2.tools.Compiler
                    [mxmlc]  at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
                    [mxmlc]  at java.security.AccessController.doPrivileged(Native Method)
                    [mxmlc]  at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
                    [mxmlc]  at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
                    [mxmlc]  at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
                    [mxmlc]  at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
                    [mxmlc]  at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
                    [mxmlc] Could not find the main class: flex2.tools.Compiler.  Program will exit.
                    [mxmlc] Exception in thread "main"


                I motify the class path on External Tools Configurations -> Class Path.

                but ant cannot find the classpath.


                Please help me


                • 5. Re: About Flex ANT Task Bug..
                  Dhruv C



                  You need to have your flex SDK and your project in the same drive when using fork=true, if these are in two different drives then you can use fork=false and it will work for you. If you want to go with fork=true you can just copy your flex SDK (not the whole flex) under the drive where you project resides.