By Nidhi Tanwar
With the release of AIR 20, the feature AIR 64-bit implies a major change for the AIR desktop developers. In the previous AIR versions, a 32-bit Runtime Dynamic Library was provided for Mac and Windows. However, with the release of AIR 20, only a 64-bit Runtime Dynamic Library is provided on Mac OS X. This means that all the new applications created by AIR developers will run on the 64-bit Runtime on Mac OS X. All the existing shared applications, captive applications, and native applications will continue to work on the 64-bit Runtime on Mac OS X.
Changes for existing applications
The existing AIR applications require the following changes when using AIR 64-bit.
Shared, Captive, and Native applications
These applications will continue to run on AIR 64-bit.
All the native applications that use a 32-bit ANE need to add a 64-bit ANE to continue working with AIR 20 and beyond on Mac OS X. To create a 64-bit ANE, you have to provide the platform value as MacOS-x86-64 in the extension descriptor file and in the command used to create the ANE.
So, a native extension descriptor file for Mac OSX will have the following structure:
<platforms> <platform name="MacOS-x86-64"> <applicationDeployment> <nativeLibrary>…</nativeLibrary> <initializer>…</initializer> <finalizer>…</finalizer> </applicationDeployment> </platform> </platforms>
And the command for creating the ANE will be:
adt -package -target ane path/where/you/want/YourANE.ane YourExtensionDescriptor.xml -swc YourAIRLibrary.swc -platform MacOS-x86-64 library.swf YourMacOSNativeLibrary.framework
Libraries and frameworks for Xcode
When you are creating the native code extension for 64-bit architecture using Xcode, the following libraries and frameworks have to be included in Xcode (see figure below):
- Adobe AIR.framework
- Adobe AIR_64
Note: If you do not add Adobe AIR_64, which is a 64-bit dylib inside the Adobe AIR framework, you may get link errors such as “ld: symbol(s) not found for architecture x86_64 error.”
Linking ANE using Flash Builder 4.7
If you are linking your AIR application with 64-bit ANE using Flash builder 4.7 by adding the ANE in ActionScript Build Path for the AIR project, you will notice that there is a red ‘X’ next to the ANE file entry in the Build Paths dialog box (see figure below). If you click the triangle, you will see the error “This ANE does not support air-native-macosx platform”. This is a quirk in Flash Builder 4.7; if you click the triangle next to Targets, you will see that MacOS-x86-64 is supported by the ANE.
The red ‘X’ issue is observed again when you are packaging the ANE by including the ANE in ActionScript Build Packaging.
Ignore the error and click OK.
When you are creating your native application from the Project >Export Release Build, Flash Builder displays a packaging error. To continue with app creation, check select Ignore Errors in Native Extensions tab and click Finish. Your application will be created successfully.
- For more information about packaging AIR applications for Mac, see Developing AIR applications for the desktop.
- For more information about creating native extensions, refer to Creating the native extension package.
- If you get Error #3500: The extension context does not have a method with name xxx, see this article for troubleshooting help.
- For information on converting 32-bit Mac OS X native extensions to 64-bit, see Developing Mac OS X Native Extensions.