01 February 2013

Not so easy to use Apache Flex 4.9 with Flash Builder


Edit : I changed the title since visitors seems to already read it and post comment to help me install Flex 4.9

Since it's still not clear if Adobe AIR and Apache Flex will evolve together or not, I previously said I won't use Apache Flex 4.9.

But, in the release note (can't find it anymore), I read it was possible to use Flash Player version as low as 10.2
I never understood why a new Flex SDK needed the last Flash Player version so it seems the Apache team finally fixed this non-sens...and give me a reason to install Flex SDK 4.9

I first tried to install Flash Builder 4.9 with the installer : FAIL => you need full rights to use it, which is rarely the case in big corporation.
So I followed the manual way but, since I don't see the point to install ant just to download and unzip files, I handled the dependencies myself.
It was the best choice since I simply used the file I already had on the 4.6 sdk folder, not waited for the  download of the 4.6 SDK archive.

But, I failed to add the SDK on Flash Builder...
adt.jar not found 

Great...the new SDK doesn't work on Flash Builder....
I wonder if it works on JetBrains IntelliJ IDEA since Apache team REALLY seems to like this IDE.
Sorry, but I can't work without my favorites Eclipse plugins, like Subclipse and some others...

How to use it without IDE ? Flash Builder ? FDT ? CLI ?

So, let ask google ! ... wait...there is an issue on Apache's JIRA !
In fact, the only thing to do is to call ide/flashbuilder/makeApacheFlexForFlashBuilder.bat !

Ok, it finally works...but why should I call makeApacheFlexForFlashBuilder.bat ?
From the realease note, it seems it's because they changed the folders architectures to something more useable ... well..not in Flash Builder it seems...

makeApacheFlexForFlashBuilder.bat also patch Apache Flex 4.9 with the last Adobe AIR SDK ... while only AIR 3.1 is officialy supported

Oh, and I finally discovered I had to download the source, install even more tools and compile the SDK myself to get 10.2 support
Edit : from comments below, it seems the README point me to the wrong direction, you haven't to recompile the SDK for 10.2 support

so, got 4.9 SDK on FB4.7 but I'm still using 4.6 SDK !

7 comments:

Anonymous said...

Flex 4.9 does work with Flash Builder. The structure have changed due to 3rd party licensing which Apache has to respect.

You can make the SDK work on earlier versions by editing the flex-config.xml and air-config.xml and changing the target-player and swf-version values. You'll also need to download the correct playerglobal.swc.

For 10.2 change target-player to 10.2 and swf-version to 11.

You can download the 10.2 playerglobal.swc from here:
http://fpdownload.macromedia.com/get/flashplayer/installers/archive/playerglobal/playerglobal10_2.swc

Nick Kwiatkowski said...

How did you download the Apache Flex SDK? Did you make it from source, grab the binaries, or use the SDK Installer?

It sounds like one of the dependancies weren't downloaded or instilled correctly.

Try grabbing the SDK from http://flex.apache.org/installer.html This is an AIR app that will download the SDK, all the dependancies, and set them up in a manner that Flash Builder (or whatever IDE) can use. You just point it to a directory, and then tell FB to use the SDK in that directory, and away you go.

William Gregoire said...

@nick : like I said I installed the binaries by hand because installer doesn't work on my secure system.
If you do this, it won't work pointing the directory. You had to call the .bat

@justin: playerglobal.swc is, from what I read, needed if you want to recompile the SDK. You can't download the SDK binaries and ask to target FP10.2.
From the readme
"The Apache Flex SDK defaults to using the Adobe Flash Player 11.1. The SDK can be compiled for Flash Player versions 10.2, 10.3, 11.0, 11.0, 11.1, 11.2, 11.3, 11.4 and 11.5."

and, from the batch file,
"This script should be used to create an Apache Flex SDK that has the directory structure that the an IDE that supports Flex, such as Adobe Flash Builder or JetBrains IntelliJ"
So the binaries doesn't work as-is

Unknown said...

I know the README suggests you need to recompile but there no need to, it's on my list to change for the next release.

OmPrakash Muppirala said...

Like any application, the Apache Flex SDK Installer honors the computer's security settings. An easy way to get around this is to create the sdk in a temporary folder where you have write access. When the installer finishes running, copy over the sdk directory over to wherever you want.

Thanks,
Om

William Gregoire said...

@justin oh ?! great to know !

William Gregoire said...

@OmPrakash sure, I never said it's not normal
I just said it's a problem on a secure PC, it's why (and because I don't see the need to install ant) I followed the manual way