It seems that while exploring native extensions I am destined to stumble upon some annoying Adobe bugs. When running ADT from terminal I'm getting the following error message:
/path/to/my/build/folder/platformoptions.xml: error 102: Invalid namespace http://ns.adobe.com/air/extension/3.4
error running adt tool
Let me explain in details how I ended there. I am building a native extension for OSX (Xcode), Windows (MS VC++) and lately for the iOS platform (Xcode too). I created three AS3 projects in Flash Builder for that purpose:
- main extension project,
- default extension project (a dummy implementation to satisfy gods when running under simulator) and
- test mobile app project (I'm uploading this to iOS devices and testing my extension with it).
I was doing more or less Ok with Flash Builder 4.6 with its out of the box AIR SDK 3.1, but I wanted to check how iOS USB debugging works so I installed Flash Builder 4.7 Beta. I also had some problems using AIR 3.1 runtime on desktop platforms (when exiting my Flex application was always crashing) so I had more than one motive to upgrade both IDE and runtime.
- After realising that FB4.7 doesn't come with AIR 3.4 (as it was advertised - this turned out to be wrong, see at the bottom) I manually overlayed it on top of FB's 4.7 folder 4.6.0 under sdks (containing actually AIR SDK 3.1). I did that successfully in the past with the FB 4.6 and the AIR SDK 3.3 (and even 3.4), so I was confident I could pull that out.
- I updated my two extension projects (main and the default dummy for the simulator) to use new AIR SDK.
- I updated the XML namespace used in the extension.xml to <extension xmlns="http://ns.adobe.com/air/extension/3.4"> to match the new AIR SDK's version.
- I updated the XML namespace in the test app's xml file to 3.4.
- I updated the XML namespace in the extension's platform options XML file to 3.4. I am using this file because I have native iOS frameworks I need to link to that is not supported by the AIR SDK out of the box (only CoreFoundation, UIKit, MobileCoreServices, CoreGraphics, SystemConfiguration, AudioToolbox, CFNetwork, QuartzCore, CoreLocation, CoreMedia, CoreVideo, AVFoundation, Foundation, OpenGLES and Security are).
It turns out that platform options file is the main problem here; I get error for anything except 3.1 namespace. Here's how my ADT call from terminal looks like:
adt -package -target ane tmp.ane extension.xml -swc $extension_main_swc -platform iPhone-ARM -platformoptions "$extension_po_xml" -C "$extension_main" . -platform default -C "$extension_default" .
And here's how my platformoptions.xml file looks:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
If i change namespace in platformoptions.xml to 3.1 I get "Namespace of platformoptions.xml should match extension namespace." etc. It turned out that the only way for this all to work is to revert all namespaces to 3.1 and compile all components (except the test app) using AIR SDK 3.1 toolchain. I had to leave test app's SDK to 3.4 to be able to use USB debugging, right? If I didn't do that, I would all the same get "The iOS Debug Binary (IDB) component is not installed."
So, dear Adobe, when will there be ADT supporting native extensions' platformoptions for AIR SDKs higher than 3.1 available?
UPDATE1: Strange, it seems that Flash Builder 4.7 is not using AIR SDK from /Applications/Adobe Flash Builder 4.7/sdks/4.6.0 folder anymore, but from /Applications/Adobe Flash Builder 4.7/eclipse/plugins/com.adobe.flash.compiler_184.108.40.2065990/AIRSDK. So FB 4.7 comes with AIR SDK 3.4 after all.