3 Replies Latest reply on Oct 5, 2011 10:58 AM by Flex harUI

    Maven built swf throwing strange error

    CRon_007 Level 1

      Hi all,

      I built my flex project (sdk 4.1)  using maven(maven -e -X install). When i tried to run the generated swf, it throws a strange error:

      VerifyError: Error #1014: Class spark.components::Application could not be found.

       

      When i run the flash builder generated swf, it runs without any problems. I guess there is something i missed to include in the pom.xml.

      Please let me know how to handle it. My project basically is built in flex sdk 4.1.

       

      Please check my pom.xml below:

       

      Thanks.

       

       

      pom.xml:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

                <parent>

                          <artifactId>abc-application</artifactId>

                          <groupId>com.abcd.abc</groupId>

                          <version>2.50.6.a</version>

                </parent>

                <modelVersion>4.0.0</modelVersion>

                <groupId>com.visualiq.iq</groupId>

                <artifactId>CW</artifactId>

                <version>2.50.6.a</version>

                <packaging>swf</packaging>

                <name>CW</name>

                          <repositories>

                          <repository>

                                    <id>flexmojos</id>

                                    <url>http://repository.sonatype.org/content/groups/flexgroup/</url>

                          </repository>

                          <repository>

                                    <id>maven2-repository.dev.maven.org</id>

                                    <name>Maven.org Repository for Maven</name>

                                    <url>http://repo1.maven.org/maven2/</url>

                                    <layout>default</layout>

                          </repository>

                </repositories>

                <properties>

                          <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

                </properties>

                <pluginRepositories>

                          <pluginRepository>

                            <id>flexmojos-repository</id>

                            <url>http://repository.sonatype.org/content/groups/flexgroup/</url>

                          </pluginRepository>

                          <pluginRepository>

                                    <id>flexpmd.opensource.adobe</id>

                                    <releases>

                                              <enabled>true</enabled>

                                    </releases>

                                    <snapshots>

                                              <enabled>true</enabled>

                                    </snapshots>

                                    <name>FlexPMD repository on opensource.adobe.com</name>

                                    <url>http://opensource.adobe.com/svn/opensource/flexpmd/maven-repository/release/</url>

                          </pluginRepository>

                </pluginRepositories>

                <build>

                    <sourceDirectory>src/main/flex</sourceDirectory>

                          <testSourceDirectory>src/test/flex</testSourceDirectory>

                          <finalName>Collaboration</finalName>

                          <plugins>

                                    <plugin>

                                              <groupId>org.sonatype.flexmojos</groupId>

                                              <artifactId>flexmojos-maven-plugin</artifactId>

                                              <version>3.9</version>

                                              <extensions>true</extensions>

                                              <dependencies>

                                                <dependency>

                                                        <groupId>com.adobe.flex</groupId>

                                                        <artifactId>compiler</artifactId>

                                                                  <version>4.1.0.16076</version>

                                                        <type>pom</type>

                                                </dependency>

                                              </dependencies>

                                              <executions>

                                                        <execution>

                                                                  <id>GroupDetachedView</id>

                                                                  <goals>

                                                                            <goal>compile-swf</goal>

                                                                  </goals>

                                                                  <phase>compile</phase>

                                                                  <configuration>

                                                                            <sourceFile>GroupDetachedView.mxml</sourceFile>

                                                                            <output>target/CW/GroupDetachedView.swf</output>

                                                                  </configuration>

                                                        </execution>

                                                        <execution>

                                                                  <id>main</id>

                                                                  <goals>

                                                                            <goal>compile-swf</goal>

                                                                  </goals>

                                                                  <phase>compile</phase>

                                                                  <configuration>

                                                                            <sourceFile>main.css</sourceFile>

                                                                            <output>target/CW/main.swf</output>

                                                                  </configuration>

                                                        </execution>

                                                        <execution>

                                                          <id>wrapper generation</id>

                                                          <goals>

                                                                  <goal>wrapper</goal>

                                                          </goals>

                                                          <configuration>

                                                                  <outputDirectory>target/CW</outputDirectory>

                                                          </configuration>

                                                        </execution>

                                              </executions>

                                              <configuration>

                                                        <sourceFile>Coll.mxml</sourceFile>

                                                        <output>target/CW/Coll.swf</output>

                                              </configuration>

                                    </plugin>

                                    <plugin>

                                              <groupId>org.apache.maven.plugins</groupId>

                                              <artifactId>maven-site-plugin</artifactId>

                                              <version>3.0-beta-3</version>

                                    </plugin>

                          </plugins>

                </build>

                <dependencies>

                          <dependency>

                            <groupId>com.adobe.flex.framework</groupId>

                            <artifactId>flex-framework</artifactId>

                                    <version>4.1.0.16076</version>

                            <type>pom</type>

                          </dependency>

                          <dependency>

                            <groupId>com.adobe.flex.framework</groupId>

                            <artifactId>playerglobal</artifactId>

                                    <version>4.1.0.16076</version>

                                    <classifier>10.1</classifier>

                            <type>swc</type>

                          </dependency>

                          <dependency>

                            <groupId>com.adobe.flexunit</groupId>

                            <artifactId>flexunit</artifactId>

                            <version>4.0-beta-2</version>

                            <type>swc</type>

                            <scope>test</scope>

                          </dependency>

                          <dependency>

                            <groupId>com.adobe.flex.framework</groupId>

                            <artifactId>datavisualization</artifactId>

                                    <version>4.1.0.16076</version>

                            <type>swc</type>

                          </dependency>

                          <dependency>

                                    <groupId>com.adobe.flex.framework</groupId>

                                    <artifactId>spark</artifactId>

                                    <type>swc</type>

                                    <scope>external</scope>

                                    <version>4.1.0.16076</version>

                          </dependency>

                          <dependency>

                            <groupId>com.adobe.flex.framework</groupId>

                            <artifactId>as3corelib</artifactId>

                                    <version>1.0</version><!-- provided swc version here need to check if

                                              the right thing to do is to specify flex framework version -->

                            <type>swc</type>

                          </dependency>

                          <dependency>

                                    <groupId>com.abcd.abc</groupId>

                                    <artifactId>CollabSWC</artifactId>

                                    <version>2.50.6.a</version>

                                    <type>swc</type>

                          </dependency>

                </dependencies>

                <reporting>

                          <plugins>

                                    <plugin>

                                              <groupId>org.apache.maven.plugins</groupId>

                                              <artifactId>maven-project-info-reports-plugin</artifactId>

                                              <version>2.3.1</version>

                                    </plugin>

                                    <plugin>

                                              <groupId>com.adobe.ac</groupId>

                                              <artifactId>flex-pmd-maven-plugin</artifactId>

                                              <version>1.2</version>

                                    </plugin>

                                    <plugin>

                                      <groupId>org.sonatype.flexmojos</groupId>

                                      <artifactId>flexmojos-maven-plugin</artifactId>

                                              <version>4.0-beta-7</version>

                                      <reportSets>

                                              <reportSet>

                                                <id>flex-reports</id>

                                                <reports>

                                                        <report>asdoc-report</report>

                                                </reports>

                                              </reportSet>

                                      </reportSets>

                                    </plugin>

                          </plugins>

                          <outputDirectory>${project.build.directory}/../../target/site/CW</outputDirecto ry>

                </reporting>

      </project>


        • 1. Re: Maven built swf throwing strange error
          Flex harUI Adobe Employee

          It sounds like some classes are being excluded from the linker because they or their swc/rsl are listed on the external-libraries option or rsl options.  I don’t know how that translates to Maven.

          • 2. Re: Maven built swf throwing strange error
            CRon_007 Level 1

            Hi harUI,

            Thasnk for your reply...

             

            I ve tried to change the scope of some dependencies to 'external'. Still i get some errors. I ve added a few more dependencies now. Everytime i change the scope i get a different error. Pleaswe go through my updated pom.xml below:

             

            <?xml version="1.0" encoding="UTF-8"?>

            <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                      xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

                      <parent>

                                <artifactId>abc-application</artifactId>

                                <groupId>com.abcd.abc</groupId>

                                <version>2.50.6.a</version>

                      </parent>

                      <modelVersion>4.0.0</modelVersion>

                      <groupId>com.abcd.abc</groupId>

                      <artifactId>CW</artifactId>

                      <version>2.50.6.a</version>

                      <packaging>swf</packaging>

                      <name>CW</name>

                                <repositories>

                                <repository>

                                          <id>flexmojos</id>

                                          <url>http://repository.sonatype.org/content/groups/flexgroup/</url>

                                </repository>

                                <repository>

                                          <id>maven2-repository.dev.maven.org</id>

                                          <name>Maven.org Repository for Maven</name>

                                          <url>http://repo1.maven.org/maven2/</url>

                                          <layout>default</layout>

                                </repository>

                      </repositories>

                      <properties>

                                <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

                      </properties>

                      <pluginRepositories>

                                <pluginRepository>

                                  <id>flexmojos-repository</id>

                                  <url>http://repository.sonatype.org/content/groups/flexgroup/</url>

                                </pluginRepository>

                                <pluginRepository>

                                          <id>flexpmd.opensource.adobe</id>

                                          <releases>

                                                    <enabled>true</enabled>

                                          </releases>

                                          <snapshots>

                                                    <enabled>true</enabled>

                                          </snapshots>

                                          <name>FlexPMD repository on opensource.adobe.com</name>

                                          <url>http://opensource.adobe.com/svn/opensource/flexpmd/maven-repository/release/</url>

                                </pluginRepository>

                      </pluginRepositories>

                      <build>

                          <sourceDirectory>src/main/flex</sourceDirectory>

                                <testSourceDirectory>src/test/flex</testSourceDirectory>

                                <finalName>Collaboration</finalName>

                                <plugins>

                                          <plugin>

                                                    <groupId>org.sonatype.flexmojos</groupId>

                                                    <artifactId>flexmojos-maven-plugin</artifactId>

                                                    <version>3.9</version>

                                                    <extensions>true</extensions>

                                                    <dependencies>

                                                      <dependency>

                                                              <groupId>com.adobe.flex</groupId>

                                                              <artifactId>compiler</artifactId>

                                                                        <version>4.1.0.16076</version>

                                                              <type>pom</type>

                                                      </dependency>

                                                    </dependencies>

                                                    <executions>

                                                              <execution>

                                                                        <id>GroupDetachedView</id>

                                                                        <goals>

                                                                                  <goal>compile-swf</goal>

                                                                        </goals>

                                                                        <phase>compile</phase>

                                                                        <configuration>

                                                                                  <sourceFile>GroupDetachedView.mxml</sourceFile>

                                                                                  <output>target/CW/GroupDetachedView.swf</output>

                                                                        </configuration>

                                                              </execution>

                                                              <execution>

                                                                        <id>main</id>

                                                                        <goals>

                                                                                  <goal>compile-swf</goal>

                                                                        </goals>

                                                                        <phase>compile</phase>

                                                                        <configuration>

                                                                                  <sourceFile>main.css</sourceFile>

                                                                                  <output>target/CW/main.swf</output>

                                                                        </configuration>

                                                              </execution>

                                                              <execution>

                                                                <id>wrapper generation</id>

                                                                <goals>

                                                                        <goal>wrapper</goal>

                                                                </goals>

                                                                <configuration>

                                                                        <outputDirectory>target/CW</outputDirectory>

                                                                </configuration>

                                                              </execution>

                                                    </executions>

                                                    <configuration>

                                                              <sourceFile>abc.mxml</sourceFile>

                                                              <output>target/CW/abc.swf</output>

                                                    </configuration>

                                          </plugin>

                                          <plugin>

                                                    <groupId>org.apache.maven.plugins</groupId>

                                                    <artifactId>maven-site-plugin</artifactId>

                                                    <version>3.0-beta-3</version>

                                          </plugin>

                                </plugins>

                      </build>

                      <dependencies>

                                <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>flex-framework</artifactId>

                                          <version>4.1.0.16076</version>

                                  <type>pom</type>

                                </dependency>

                                <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>playerglobal</artifactId>

                                          <version>4.1.0.16076</version>

                                          <classifier>10.1</classifier>

                                  <type>swc</type>

                                </dependency>

                                <dependency>

                                  <groupId>com.adobe.flexunit</groupId>

                                  <artifactId>flexunit</artifactId>

                                  <version>4.0-beta-2</version>

                                  <type>swc</type>

                                  <scope>test</scope>

                                </dependency>

                                <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>textLayout</artifactId>

                                  <version>4.1.0.16076</version>

                                  <type>swc</type>

                                  <scope>caching</scope>

                                </dependency>

                                <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>framework</artifactId>

                                  <version>4.1.0.16076</version>

                                  <type>swc</type>

                                  <scope>caching</scope>

                                </dependency>

                                <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>datavisualization</artifactId>

                                          <version>4.1.0.16076</version>

                                  <type>swc</type>

                                </dependency>

                                <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>textLayout</artifactId>

                                  <version>4.1.0.16076</version>

                                  <type>swc</type>

                                  <scope>caching</scope>

                                </dependency>

                                <dependency>

                                          <groupId>com.adobe.flex.framework</groupId>

                                          <artifactId>spark</artifactId>

                                          <type>swc</type>

                                          <scope>caching</scope>

                                          <version>4.1.0.16076</version>

                                </dependency>

                                <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>sparkskins</artifactId>

                                  <version>4.1.0.16076</version>

                                  <type>swc</type>

                                  <scope>caching</scope>

                                </dependency>

                                <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>as3corelib</artifactId>

                                          <version>1.0</version><!-- provided swc version here need to check if

                                                    the right thing to do is to specify flex framework version -->

                                  <type>swc</type>

                                </dependency>

                                  <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>rpc</artifactId>

                                  <version>4.1.0.16076</version>

                                  <type>swc</type>

                                  <scope>caching</scope>

                                </dependency>

                                <dependency>

                                  <groupId>com.adobe.flex.framework</groupId>

                                  <artifactId>flex-framework</artifactId>

                                  <version>4.1.0.16076</version>

                                  <type>pom</type>

                                </dependency>

                                <dependency>

                                          <groupId>com.visualiq.iq</groupId>

                                          <artifactId>CollaborationSWC</artifactId>

                                          <version>2.50.6.a</version>

                                          <type>swc</type>

                                </dependency>

                      </dependencies>

                      <reporting>

                                <plugins>

                                          <plugin>

                                                    <groupId>org.apache.maven.plugins</groupId>

                                                    <artifactId>maven-project-info-reports-plugin</artifactId>

                                                    <version>2.3.1</version>

                                          </plugin>

                                          <plugin>

                                                    <groupId>com.adobe.ac</groupId>

                                                    <artifactId>flex-pmd-maven-plugin</artifactId>

                                                    <version>1.2</version>

                                          </plugin>

                                          <plugin>

                                            <groupId>org.sonatype.flexmojos</groupId>

                                            <artifactId>flexmojos-maven-plugin</artifactId>

                                                    <version>4.0-beta-7</version>

                                            <reportSets>

                                                    <reportSet>

                                                      <id>flex-reports</id>

                                                      <reports>

                                                              <report>asdoc-report</report>

                                                      </reports>

                                                    </reportSet>

                                            </reportSets>

                                          </plugin>

                                </plugins>

                                <outputDirectory>${project.build.directory}/../../target/site/CW</outputDirecto ry>

                      </reporting>

            </project>

            • 3. Re: Maven built swf throwing strange error
              Flex harUI Adobe Employee

              Sorry, I don’t know anything about Maven.  You want fewer external dependencies, not more, or at least, match up your dependencies with rsls.