Как исправить flexmojos: тип не найден - UncaughtErrorEvent (Flex 4.1)
Я использую flexmojos 3.8 с компилятором flex 4.1.0.16248
Мой проект прекрасно компилируется в Flash Builder, но с flexmojos / maven я получаю следующую ошибку:
Type was not found or was not a compile-time constant: UncaughtErrorEvent
Код Flex выглядит следующим образом:
loaderInfo.uncaughtErrorEvents.addEventListener(UncaughtErrorEvent.UNCAUGHT_ERROR, onUncaughtError);
Flex Compiler 4.1 должен знать тип UncaughtErrorEvent. Почему происходит сбой?
2 ответа
Решение
Нашел решение:
<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>
Вам нужно будет настроить таргетинг на флеш-плеер 10.1 вместо 10.0
Не уверен, как это сделать в Maven, но это, вероятно, ваша проблема.