4 Replies Latest reply on Oct 5, 2007 11:35 AM by k1cheng

    Unable to locate specified base class 'mx.core.Application'

    supergirl_gem
      Hi,

      i'm currently using ANT to compile my mxml files but I'm getting the following error Unable to locate specified base class 'mx.core.Application' can anyone help?

      Thanks

      Gemma
        • 1. Re: Unable to locate specified base class 'mx.core.Application'
          Gaurav J Adobe Employee
          HI,

          This shouldn't happen source path is incorrectly set in the ant target. Can you send the ant target that you are using for the compilation.

          Thanks,
          Gaurav
          • 2. Unable to locate specified base class 'mx.core.Application'
            k1cheng
            Hi,

            I get the same same error as supergirl_gem. I can build my app fine within Flex Builder 2, but I can't quite get the command-line compiler to work.

            Here is my ant target:

            <target name="flexc" description="Compile Flex sources">
            <exec executable="${flex.mxmlc}" failonerror="true">
            <arg line="${dir.srcmxml}/tds_flex.mxml -output '${dir.srcmxml}/tds_flex.swf' -locale en_US -library-path WEB-INF/lib"/>
            </exec>
            </target>

            When executing this line, I get the following on stderr:

            C:\targus\tds\jboss\server\tds1\deploy\tds.war\tds_flex.mxml: Error: Unable to locate specified base class 'mx.core.Application' for component class 'tds_flex'.

            mx\generated\GeneratedLocale.as(5): col: 55 Error: The definition of base class Locale was not found.

            public class GeneratedLocale extends mx.resources.Locale
            ^

            I'm very new to Flex, so my guess might not be very good but it seems the mx.resources and mx.core packages are some sort of standard deliverable included with the SDK, and the problem is simply a matter of linking it correctly. However, I could not find any reference to it in the Flex Builder project properties/buld path setup.

            I have also tried the flex ant tasks available via adobe labs, but I get other errors with those and they seem more intractable so I am pursuing this avenue. Does anyone have any suggestions? Perhaps some way to see the exact compiler call that Flex Builder uses to build?

            Thanks,
            KaJun
            • 3. Re: Unable to locate specified base class 'mx.core.Application'
              Gaurav J Adobe Employee
              KaJun,

              You are getting this error because your library-path is set to web-INF/lib, but the flex required swc files are under <flex sdk>/frameworks/libs folder.

              What issue were you facing with the flex ant task? The ant tasks are now packaged with the sdk under the ant directory so you should use those, but still refer to the documentation for ant task at labs.adobe.com. I suggest moving to flex ant tasks for flex related compilation. If you face any issues, please let me know. I would be happy to help you with flex ant task.

              Thanks,
              Gaurav
              • 4. Re: Unable to locate specified base class 'mx.core.Application'
                k1cheng Level 1
                Hi Gaurav,

                Thank you for the quick reply. We are using the WEB-INF/lib directory because of some extra .swc files, and the compiler would complain about being unable to find classes in both the SDK frameworks/libs as well as our own flexlib.swc. I later found that the library-path option can be appended to the existing path using a += syntax, but I still couldn't get the compiler to do a clean compile. I think I made things difficult for myself by having two different SDKs involved as well, and I thought there might have been issues with linking to different SDK versions and/or linking to different paths incorrectly, in addition to setting the locale via the command line. I finally got it to compile correctly by lumping all the .swc libraries into a flexlibs directory, and invoking the compiler thusly:

                <target name="flexc" description="Compile Flex sources">
                <exec executable="${flex.mxmlc}" failonerror="true">
                <arg line="${dir.srcmxml}/tds_flex.mxml -library-path build/flexlibs/libs build/flexlibs/locale/en_US"/>
                </exec>
                </target>

                For now I'll leave it at that, and try the flex ant tasks again. I think yesterday was just a bad voodoo day for me. I'll ask for help if I get really stuck today as well.

                Thanks again,
                KaJun