SWZ, RSL and Flexmojos Build Setup

With default Flexmojo build setup your clients may easily fall into .swz load issue. Why clients? Because you already have .swz files cached in your player but they dont. Sure, you can turn off caching easily. The issue is textLayout and osmf uses a different version numbering and .swz location than the rest of the flex sdk .swzs. The exception by flex application may look something like this:

Error #2032: Stream Error. URL: http://fpdownload.adobe.com/pub/swz/flex/4.1.0.16076/textLayout_4.1.0.16076.swz
Error #2032: Stream Error. URL: http://fpdownload.adobe.com/pub/swz/flex/4.1.0.16076/osmf_4.1.0.16076.swz

Those links are invalid as you can compare those to original in flashbuilder/sdks/4.1.0.16076/frameworks/flex-config.xml … Its easy to fix it with a few lines of code in your build setup:

<properties>
	<flex.sdk.version>4.1.0.16076</flex.sdk.version>
	<flex.tlf.version>1.1.0.604</flex.tlf.version>
	<flex.osmf.version>4.0.0.13495</flex.osmf.version>
	...
<policyFileUrls>
	<url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
	<url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
	<url>http://fpdownload.adobe.com/pub/swz/crossdomain.xml</url>
</policyFileUrls>

<rslUrls>
	<url>http://fpdownload.adobe.com/pub/{extension}/tlf/${flex.tlf.version}/{artifactId}_${flex.tlf.version}.{extension}</url>
	<url>http://fpdownload.adobe.com/pub/{extension}/flex/${flex.sdk.version}/{artifactId}_flex.${flex.osmf.version}.{extension}</url>
	<url>http://fpdownload.adobe.com/pub/{extension}/flex/${flex.sdk.version}/{artifactId}_{version}.{extension}</url>
</rslUrls>

It is also important to maintain dependency order… here is a correct configuration for flex 4.1.0.16076. It seems ok to rely on dependency for textLayout and osmf from default com.adobe.flex.framework group.

<dependencies>
	<dependency>
		<groupId>com.adobe.flex.framework</groupId>
		<artifactId>textLayout</artifactId>
		<version>${flex.sdk.version}</version>
		<type>swc</type>
		<scope>caching</scope>
	</dependency>

	<dependency>
		<groupId>com.adobe.flex.framework</groupId>
		<artifactId>osmf</artifactId>
		<version>${flex.sdk.version}</version>
		<type>swc</type>
		<scope>caching</scope>
	</dependency>

	<dependency>
		<groupId>com.adobe.flex.framework</groupId>
		<artifactId>framework</artifactId>
		<version>${flex.sdk.version}</version>
		<type>swc</type>
		<scope>caching</scope>
	</dependency>

	<dependency>
		<groupId>com.adobe.flex.framework</groupId>
		<artifactId>spark</artifactId>
		<version>${flex.sdk.version}</version>
		<type>swc</type>
		<scope>caching</scope>
	</dependency>

	<dependency>
		<groupId>com.adobe.flex.framework</groupId>
		<artifactId>sparkskins</artifactId>
		<version>${flex.sdk.version}</version>
		<type>swc</type>
		<scope>caching</scope>
	</dependency>

	<dependency>
		<groupId>com.adobe.flex.framework</groupId>
		<artifactId>rpc</artifactId>
		<version>${flex.sdk.version}</version>
		<type>swc</type>
		<scope>caching</scope>
	</dependency>

	<dependency>
		<groupId>com.adobe.flex.framework</groupId>
		<artifactId>datavisualization</artifactId>
		<version>${flex.sdk.version}</version>
		<type>swc</type>
		<scope>caching</scope>
	</dependency>

	<dependency>
		<groupId>com.adobe.flex.framework</groupId>
		<artifactId>flex-framework</artifactId>
		<version>${flex.sdk.version}</version>
		<type>pom</type>
	</dependency>

Leave a comment

Please be polite and on topic. Your e-mail will never be published.