apache-flexmavenflexmojos

How to fix flexmojos: Type was not found - UncaughtErrorEvent (Flex 4.1)


I'm using flexmojos 3.8 with flex compiler 4.1.0.16248

My Project compiles fine in Flash Builder, but with flexmojos / maven I get the following Error:

Type was not found or was not a compile-time constant: UncaughtErrorEvent

The Flex Code looks like this:

loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);

The Flex Compiler 4.1 should know the type UncaughtErrorEvent - Why does it fail?


Solution

  • Found the Solution:

    flexmojos mailing list

    <dependency>
      <groupId>com.adobe.flex.framework</groupId>
      <artifactId>flex-framework</artifactId>
      <version>${flex.version}</version>
      <type>pom</type>
      <exclusions>
        <exclusion>
          <groupId>com.adobe.flex.framework</groupId>
          <artifactId>playerglobal</artifactId>
        </exclusion>
      </exclusions>
    </dependency>
    <dependency>
      <groupId>com.adobe.flex.framework</groupId>
      <artifactId>playerglobal</artifactId>
      <version>${flex.version}</version>
      <classifier>10.1</classifier>
      <type>swc</type>
    </dependency>
    <plugin>
        <groupId>org.sonatype.flexmojos</groupId>
        <artifactId>flexmojos-maven-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
            ...
            <targetPlayer>10.1</targetPlayer>
            ...
        </configuration>
    </plugin>