AIR iOS app packaging with Flash Tooling and AIR 3.3

If you are using iOS Native Extensions with AIR 3.3, you may find that your application does not get packaged when using Flash Builder/Flash Pro. This is because, when using native extensions, linker warnings are not suppressed, and Flash Builder/Flash Pro are not able to handle such large number of warnings, specifically on Windows. This issue will be fixed in the upcoming release of Flash Builder and Flash Pro.

In order to overcome this issue, you can include the platform descriptor file (platform.xml) in your ANE, which contains the following linker option:

<option>-w</option>

A sample platform descriptor file will look like this:

<platform xmlns="http://ns.adobe.com/air/extension/3.1">
 <sdkVersion>5.0</sdkVersion> 
 <linkerOptions> 
 <option>-w</option> 
 </linkerOptions> 
</platform>

Then, at the time of packaging the ANE, include the ADT switch -platformoptions, providing the path to the platform descriptor file. For example,

adt -package 
-target ane myextension.ane extension.xml 
-swc mySwc.swc 
-platform iPhone-ARM library.swf libmylib.a 
-platformoptions platform.xml

However, if you do not have the ANE source files, you can always package the IPA using the ADT command line. More help on using the ADT command line can be found here. For instance,

adt -package 
-target ipa-app-store 
-storetype pkcs12  
-keystore ../AppleDistribution.p12  
-provisioning-profile AppleDistribution.mobileprofile  
myApp.ipa myApp-app.xml myApp.swf icons Default.png

24 Responses to AIR iOS app packaging with Flash Tooling and AIR 3.3

  1. Subodh K Sharma says:

    Hi,
    I’m using the “NetworkInfo native extension” from the sample provided in http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/networkinfo.html
    I’m building my mobile project in Flash Builder 4.6 with AIR 3.3 SDK.
    The ipa packaging is done with Flash Builder Run Configurations which results in packaging stuck at 57%.
    How can i do the above changes in FB with this ANE file.

    Thanks

    • neha says:

      Hi Subodh,
      I am assuming that you are on a Windows machine.
      For repackaging the ANE, you will have to use the command line. You may follow these steps:
      1) Download Binaries.zip from http://www.adobe.com/devnet/air/native-extensions-for-air/extensions/networkinfo.html and extract it. You will find a .swc file and a .ane file. Copy the swc file to a folder, say pkg.
      2) Rename the com.adobe.extension.Networkinfo.ane to com.adobe.extension.Networkinfo.zip. Extract it and copy library.swf, the .a file and the extension.xml file in the folder created above, pkg.
      3) Open the command prompt and cd to the folder pkg.
      4) Create a file called platform.xml with the contents provided in the above article.
      5) Now, issue the following command:
      /bin/adt -package -target ane networkinfo.ane extension.xml -swc NetworkInfoActionScriptLibrary.swc -platform iPhone-ARM library.swf libNetworkInfoiOSLibrary.a -platformoptions platform.xml
      6) In the project properties, link to the networkinfo.ane created above and unlink the previously linked ANE.

      • cchilds says:

        Wow, this is awesome! Thanks so much for the thorough explanation. I was stumped as to why I couldn’t create a release build for iOS. This worked perfectly.

      • Ryan says:

        The step where you say to rename the .ane to a .zip and then extract…. First off, the “library.swf”, “.a file”, and the “extension.xml” are not the files you see when you first extract… you will see “META-INF”, “catalog.xml”, “mimetype”, and a “library.swf” (im guessing different that the 1 in the META-INF folder”…

        Inside the “META-INF” folder, is another folder called “ANE”, inside “ANE” is another folder called “iphone-ARM”… and finally inside this folder is the items listed above to try to put in the “pkg” folder….

        so my question is… how can I extract an ANE, and only use “parts” of the extracted contents when trying to recompile the ANE to include this “-w” trick with the platform.xml

  2. Sam Fisher says:

    Hi, Is there any tutorial or guide to install AIR 3.3 with Flash Builder 4.6 Windows? Thanks

  3. HB says:

    I had to deliver an iPhone app today, and decided to upgrade to AIR 3.3 so I could add the new iPad 3 icon. However I stumbled into this problem, so I decided to revert back to AIR 3.2.

    I’ll have to look into making some batch files for adt for the time being.

  4. Ali Raza says:

    When can we expect a new release of Flash Builder?

  5. Jason says:

    Has anyone converted the 5.0.1 ie.jampot.MobileBackup ANE? I attempt to do it, thought I did it correctly (using comments above) but it comes with code, not a SWC. So I made a Flex library, brought the code in (ie.jampot.*) and that created a SWC. I unzipped the ANE, grabbed the static library and extension.xml, adt compiled it, got an ANE.. Only problem is when I go to use it Flash Builder tells me it can’t find a class ie.jampot.MobileBackup.. So I ditched the SWC and just used the code like I was before but with the newly compiled ANE containing the compiler flag. I can not compile it but continue to get errors that I cannot instantiate it.

  6. Pascal says:

    Hi,

    Thanks for the useful information.

    I would like to know if a FB update is planed to support this? Any FB 4.6.x or 4.7 soon?

    Pascal

    • neha says:

      There will be a new release of Flash Builder, which will support this. However, I cannot say as to when it will be released.

  7. HB says:

    Would be nice if Adobe would follow “new” Apple data storage guidelines, and add native NetworkInfo in the next AIR release.

  8. Ryan says:

    Is there any way to repackage an ANE to contain this -w without the original source files? I tried to follow the tutorial from the comments above involving renaming the .ane to a .zip, but I believe my .ane is a lil more advanced than the 1 listed above as it is for both iOS and Android, and contains “META-INF”, “catalog.xml”, “mimetype” and some other stuff not included in the example above…and I have no idea how to package all that stuff and of course I cant find a tutorial about my scenario. Not to mention the above uses a “swc” that I cannot find once I unzip the “ane”… i am really lost

  9. Ryan says:

    Wow this issue is really driving me crazy… aren’t there flash developers everywhere trying to compile to AIR 3.3 and including things like admob???? Why is this the only article online addressing the issue… This problem puts me dead in the water when I do not have access to source files used in creating a native extension, so I cannot do the trick to include the “-w” part.

    • neha says:

      Hi Ryan,

      This issue is fixed in the latest AIR 3.4 beta build. You may want to try it.
      If you have to use 3.3 only,
      1) Rename the .ane to .zip.
      2) Unzip the zip file.
      3) Find the platform.xml file and add -w option to it.
      4) Zip the folder again.
      5) Rename the .zip to .ane.

  10. Marko says:

    OK I try everything but -w doesn’t work.

    My project is in AIR 3.3 plus I have external library project in AIR 3.3… I package ANE file for Android and iOS with platform options -w for iOS.. and still got the same error:

    Error occurred while packaging the application:

  11. Tomas says:

    Hi!

    I’m trying to use one of AdMob Native Extension for iOS which I found on Internet in my AIR3.3 project but without success. So when I was searching on google for meaning of some warnings which I get during compilation, I found this article and tried repackage this extensions step by step, following methods desrcibed by you in comment but again without any success.

    Links on AdMob extensions which I tried to use in my AIR project.
    http://lancelotmobile.com/blog/admob-ane/
    http://code.google.com/p/flash-air-admob-ane-for-ios/downloads/list
    http://www.enriquedavid.es/adobe-native-extension-admob.html

    I build .ipa on Win7, I tried build .ipa in Flash CS5.5, Flash CS6 and with command line. After I repacked extensions with methods which you described in comments some with first method(packed with command line) and some with method 2 (where extensions contains “META-INF”, “catalog.xml” etc.). After that I get final .ipa file without warnings during compilation. But, when I want to install application on iPad, process fails during installation of app.

    But without extensions app installation complelete successfully. Now I tried use AIR3.4 beta but nothing changed.

    I would be thankful for any advice. Thanks

    • neha says:

      This is very strange.

      Tomas, can you try without using the -w option, and packaging your application from the command line using adt?
      And paste the list of warnings you are getting here.
      Also, what is the error you get in iTunes at the time of installing the application?

      • Tomas says:

        Hi neha,

        this is output from command line for admob extensions, for all was same output.

        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/crt1.o
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_addsubdf3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_fixunsdfdi.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_udivdi3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_umoddi3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_modsi3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_udivsi3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_umodsi3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_divsi3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_dvmd_tls.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_clz.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_fixdfsi.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_fixunsdfsi.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_addsubsf3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_fixdfdi.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_divdi3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_moddi3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_cmpdf2.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_muldivdf3.o)
        ld: warning: CPU_SUBTYPE_ARM_ALL subtype is deprecated: C:\\Program Files (x86)\
        \Adobe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_unorddf2.o)
        ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not al
        lowed in code signed PIE, but used in ___divdi3 from C:\\Program Files (x86)\\Ad
        obe\\Adobe Flash CS6\\AIR3.3\\lib\\aot/lib/gcc/libgcc.a(_divdi3.o). To fix this
        warning, don’t compile with -mdynamic-no-pic or link with -Wl,-no_pie

        iTunes worked without errors. During installation of app I got any error from iTunes, and synchronization of iPad finished successfully, but on iPad installation bar froze in middle and after about minute I got popup with warn text something like “installation of this app failed. You can try install app again or delete app.”

        • neha says:

          Hi Tomas,

          It seems like your issue is not related to the warnings at all, but there’s something wrong with your provisioning profile/certificate. Please refer to http://forums.adobe.com/thread/931324 for a similar issue.

          In that case, I think you will get a clearer error message if you use the XCode Organizer to install your application on device.

          Please check 1 more thing, that your application.xml contains the 2 under the UIDeviceFamily key

  12. Tomas says:

    Thanks for link and all advices, I’ll try to solve it as soon as possible.

  13. Avila says:

    Hi,

    Thanks for the article.

    I’m using UIWebview Native Extension IOS from http://matthewhx.blogspot.com.es/2012/04/uiwebview-native-extension-ios-example.html

    But I have a problem when I try to compile the ipa. I use the option “Export release build”.

    I repacked the ANE as I see in other comments and I put the -w option, but it doesn’t work for me. The process of compiling the ipa never finishes.

    I’m on windows 7 and I use flash builder 4.6

    Can anyone help me?

    Thank you

  14. Ginsca Bogdan says:

    Hi,
    We have a problem and we dont know what to do since there are now errors.
    We use Admob from milkmangames on an ap that was developed for IOS – IPAD . The app runs ok when we didnt use the Admob extension but after we incorporate it , when we test it the app starts with a black background wich stays foe 1 second and after that it closes. Again we have no errors when compiling the ipa.