How to Overlay Flex 4.6 with AIR 4.0 SDK

AdobeAIR

Adobe AIR 4.0 Software Development Kit (SDK) is now officially released!  Here’s how to set it up.

 

Despite the overly-complicated instructions on the interwebs, the process is ridiculously simple. Basically all we’re doing is copying the newer AIR files into the most recent Flex folder and then changing a few settings in our project.

 

This process is likely to be the same for all future versions.  This time around we’ll be overlaying Flex 4.6 with AIR 4.0 SDK and ensuring that the new Flash Player 12 is also included.

We’ll do it in three steps, each of which has been broken down into workable baby-steps.  I added personal notes specific to my particular operating system and IDE. However, the process is similar for all.  If you get any pop-ups asking if you want to replace files or asking for permission, answer yes to all.

  ***Android Users: Please note that AIR 3.7+ requires Android 2.3+ to run.  If your program crashes without warning after upgrading to AIR 4.0 then check your device’s system info.  If you’re running Android 2.2 or earlier then you currently have two options to get up and running again:  Backup your contacts and do a system update or revert back AIR 3.6 Runtime on your Android device.

 

1) PREPARE YOUR SDK FOLDER

 

A)  Download the most recent Flex SDK, AIR SDK (see note for Flex Users), and Flash Player (playerglobal.swc)

 

B)  Unzip the Flex SDK and rename it to something more meaningful.

As of the time of writing this, Abode AIR 4.0 SDK was just released, which overlays the Flex 4.6 SDK and runs in Flash Player 12  ….so I named mine “AIR4.0_Flex4.6_Flash12”
 

C)  Unzip the AIR SDK and then copy its contents into the Flex SDK folder you just created.

 This will merge all folders and files with the newer AIR files.
***Mac Users:  By default, Mac/OSX replaces folders instead of merging them so you will need to use a third party merge tool to do this instead.
 

D)  Navigate to “frameworks\libs\player”.  This is just to make sure that there’s a folder there containing the most recent playerglobal.swc file.  If it is there already, skip the rest of this step. If not, create the folder and copy over the playerglobal.swc file you downloaded earlier.  

Sometimes the playerglobal.swc file and folder are already there for you but this time around I did have to add it myself.  I added it to “frameworks\libs\player\12.0”.

 

2) UPDATE YOUR IDE & PROJECT TO USE THE NEW SDK

 

A)  Move your entire SDK folder into your IDE’s SDK folder. You can store the folder anywhere but the program folder’s SDK folder seems the proper place. Some people prefer to keep all their SDKs in the same place, regardless of IDE, so something like C:\SDK would also be a good place.

I moved mine to “C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.5\sdks”.
 
B)  Open your project and configure your new SDK. Make sure the box next to the new SDK is checked when you’re done. To do this in Flash Builder, right click on your project and go to “Properties”.  Then navigate to “Flex Compiler->Configure Flex SDKs” and add the new folder.
 
This should look familiar… “C:\Program Files (x86)\Adobe\Adobe Flash Builder 4.5\sdks\AIR4.0_Flex4.6_Flash12“.
 

3) UPDATE YOUR PROJECT COMPILER SETTING AND PROJECT XML FILE.

 

A)  While still in your project’s “Flex Compiler” window, add/update the following compiler argument:

-swf-version=23

 

B) Open your project’s XML file and update the following line to use AIR 4.0 like so:

<application xmlns=”http://ns.adobe.com/air/application/4.0″>

 

 

 

4) That’s it!  Now just share this with your fellow developers and you’re all done!

If you have any questions or helpful tips/resources then please leave a comment below.  It only takes a moment and will make you feel nice.

 
Enjoy!
 
-John Hutchinson (Rubber Ducky Games)
 
16 thoughts on “How to Overlay Flex 4.6 with AIR 4.0 SDK
    • Your explanation is very vague so I can only guess at your meaning. Please provide the precise error message, word for word, plus how you received it. If you can provide a screenshot then that would also be helpful.

      Do you mean that Flash Builder is telling you that it’s an invalid folder when you “configure SDK” from within your project’s compiler settings?

      If so, did you manually look inside the folder to make sure that it does indeed contain the SDK files? Are you adding the wrong folder? Are you trying to add the zip file by mistake? Do you have administrator rights?

      As a test, please download a fresh copy of the Flex SDK, extract it to its own folder and try to configure that in Flash Builder (without any changes whatsoever).

      Once you’ve confirmed that you can successfully add a Flex SDK folder to Flash Builder, try the whole thing again with a new folder containing the both Flex SDK files and newer the AIR SDK files… Extract the contents of both archives (zip files), each into its own folder. Then copy content of the AIR folder into the Flex folder, overwriting all files and folders (there will be several overwrites). This combined folder is what you should be using.

      If you still have issues after reading this, please provide as detailed information as possible and I will try to help you troubleshoot. If you figured out what went wrong, please provide the solution in case anyone else encounters a similar issue. Thank you.

    • I suspect you are a Mac user?
      if so, the problem is that when you copy newly downloaded AIR files over the Flex SDK files it ‘replaced’ the entire subfolders, and not merge them. ie, Flex SDK files were deleted. not not merged with additional AIR files
      solution is to use Folder Merge tool for OS X (google it)
      Good luck

  1. Thank you for the well written post – it saved me at least a good couple of hours, now I just need to work out why all my charts have fallen over! Nige

Leave a Reply

Your email address will not be published. Required fields are marked *

9 − two =