3 Replies Latest reply on Apr 7, 2010 12:24 PM by smagfx2

    mxmlc error

    smagfx2 Level 1

      I'm trying to set up an ant buildfile that will compile a bunch of small Actionscript projects and do some other small tasks. My problem is with mxmlc when specifying the output SWF file's location.

       

      The relevant stuff from build.xml looks like this:

       

      <exec executable="C:/Program Files (x86)/Adobe/Adobe Flash Builder 4/sdks/3.5.0/bin/mxmlc.exe"

                     failonerror="true">

                     <arg value="${minisrc}/movie/src/Movie.as"/>

                     <arg value="-incremental"/>

                     <arg value="-debug=true"/>

                     <arg value="-load-config+=${MINIGAME_CONFIG}"/>

                     <arg value="-output ${minidist}/blah/Movie.swf"/>

                </exec>

      That last argument is what is giving me problems. If I leave it out, mxmlc runs fine but does not place the SWF where I want it. If I try to run it like the above then I get:

      command line: Error: unknown configuration variable 'output D:\giantpath/../../dist/blah/Movie.swf'

      I've tried putting the path in double quotes and single quotes but nothing seems to work.

       

      I am actually doing the above because of another error with ant/flex/fb/mxmlc:

       

      I would like to use this XML to run mxmlc:

       

      <mxmlc file="${minisrc}/movie/src/Movie.as" output="${minidist}/movie/Movie.swf"

                     fork="true" maxmemory="512m" incremental="false" debug="true">

                     <load-config filename="${MINIGAME_CONFIG}"/>

                </mxmlc>

       

      However, that gives me the following error:

       

          [mxmlc] java.lang.NoClassDefFoundError: flex2/tools/Compiler

          [mxmlc] Caused by: java.lang.ClassNotFoundException: flex2.tools.Compiler

          [mxmlc]      at java.net.URLClassLoader$1.run(Unknown Source)

          [mxmlc]      at java.security.AccessController.doPrivileged(Native Method)

          [mxmlc]      at java.net.URLClassLoader.findClass(Unknown Source)

          [mxmlc]      at java.lang.ClassLoader.loadClass(Unknown Source)

          [mxmlc]      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

          [mxmlc]      at java.lang.ClassLoader.loadClass(Unknown Source)

          [mxmlc]      at java.lang.ClassLoader.loadClassInternal(Unknown Source)

          [mxmlc] Could not find the main class: flex2.tools.Compiler.  Program will exit.

          [mxmlc] Exception in thread "main"

       

      I did some research and set fork to false, but then it is even worse, giving me:

       

        [mxmlc] D:\projectpath\client\src\com\blah\iface\minigames\IGame.as(1): col: 1 Error: The definition of base class Object was not found.

          [mxmlc] package com.blah.iface.minigames

          [mxmlc] ^

          [mxmlc] D:\projectpath\client\src\com\blah\iface\minigames\IGame.as(23): col: 33 Error: Interface IEventDispatcher was not found.

          [mxmlc] public interface IGame extends IEventDispatcher

          [mxmlc]                               ^

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/core/IFlexDisplayObject)

          [mxmlc] Error: Type was not found or was not a compile-time constant: [flash.display]::IBitmapDrawable.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/core/IFlexDisplayObject)

          [mxmlc] Error: Type was not found or was not a compile-time constant: [flash.events]::IEventDispatcher.

          [mxmlc] Movie_FBNormalFont.as(1): col: 1 Error: Namespace was not found or is not a compile-time constant.

          [mxmlc] ^

          [mxmlc] Movie_FBBoldFont.as(1): col: 1 Error: Namespace was not found or is not a compile-time constant.

          [mxmlc] ^

          [mxmlc] D:\projectpath\client\lib\FlexUnit1Lib.swc(mx/core/FontAsset)

          [mxmlc] Error: Type was not found or was not a compile-time constant: String.

          [mxmlc] D:\projectpath\client\lib\FlexUnit1Lib.swc(mx/core/FlexBitmap)

          [mxmlc] Error: Type was not found or was not a compile-time constant: String.

          [mxmlc] D:\projectpath\client\lib\FlexUnit1Lib.swc(mx/core/FlexBitmap)

          [mxmlc] Error: Type was not found or was not a compile-time constant: BitmapData.

          [mxmlc] D:\projectpath\client\lib\FlexUnit1Lib.swc(mx/core/FlexBitmap)

          [mxmlc] Error: Type was not found or was not a compile-time constant: String.

          [mxmlc] D:\projectpath\client\lib\FlexUnit1Lib.swc(mx/core/FlexBitmap)

          [mxmlc] Error: Type was not found or was not a compile-time constant: Boolean.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/utils/NameUtil)

          [mxmlc] Error: Type was not found or was not a compile-time constant: DisplayObject.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/utils/NameUtil)

          [mxmlc] Error: Type was not found or was not a compile-time constant: String.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/utils/NameUtil)

          [mxmlc] Error: Type was not found or was not a compile-time constant: Object.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/utils/NameUtil)

          [mxmlc] Error: Type was not found or was not a compile-time constant: String.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/core/IRepeaterClient)

          [mxmlc] Error: Type was not found or was not a compile-time constant: Array.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/core/IRepeaterClient)

          [mxmlc] Error: Type was not found or was not a compile-time constant: Array.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/core/IRepeaterClient)

          [mxmlc] Error: Type was not found or was not a compile-time constant: Boolean.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/core/IRepeaterClient)

          [mxmlc] Error: Type was not found or was not a compile-time constant: Array.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/core/IRepeaterClient)

          [mxmlc] Error: Type was not found or was not a compile-time constant: Array.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/core/IRepeaterClient)

          [mxmlc] Error: Type was not found or was not a compile-time constant: Array.

          [mxmlc] D:\projectpath\client\lib\Degrafa_Beta3.1_Flex3.swc(mx/core/IRepeaterClient)

          [mxmlc] Error: Type was not found or was not a compile-time constant: Array.

       

      So, it'd be great if anyone could help me getting one of these two methods to work.

        • 1. Re: mxmlc error
          GordonSmith Level 4

          Using the <mxmlc> Ant task is the recommended approach. You need to set an environment variable called FLEX_HOME so that <mxmlc> knows where the SDK (and therefore the compiler) is.

           

          Gordon Smith

          Adobe Flex SDK Team

          • 2. Re: mxmlc error
            GordonSmith Level 4

            The build.xml files inside the SDK itself do this with a tag like

             

            <property name="FLEX_HOME" location="..."/>

            inside the <project>.

             

            Gordon Smith

            Adobe Flex SDK Team

            • 3. Re: mxmlc error
              smagfx2 Level 1

              Thank you for the response,

               

              I should have mentioned in my first post that I am running Windows 7 64-bit. Also, I was defining FLEX_HOME in this manner:

               

              <property file="../build.properties"/>

               

              And the contents of that file are:

               

              FLEX_HOME=C:/Program Files (x86)/Adobe/Adobe Flash Builder 4/sdks/3.5.0

               

              But I get the NoClassDefFoundError.

               

              If I define FLEX_HOME inside build.xml with a property tag like this:

               

              <property name="FLEX_HOME" location="C:/Program Files (x86)/Adobe/Adobe Flash Builder 4/sdks/3.5.0"/>

               

              I get the same error, NoClassDefFoundError.