Skip to main content
Inspiring
July 27, 2012
Question

iOS only extension

  • July 27, 2012
  • 3 replies
  • 2598 views

I am developing an app that is targetted for iOS and Android. On iOS I need to make use of an exension that is only supported on iOS. If I include the exension in my Flash Builder project, I can no longer deploy to the simulator. I receive an error like "The content cannot be loaded because there was a problem loading an extension: Error: Requested extension XXX is not supported for MacOS-x86." Do I need to create a stub extension for MacOS-x86 or is there a simpler way?

This topic has been closed for replies.

3 replies

sbhave
Participating Frequently
July 30, 2012

Going by the error you have mentioned. You are trying on AIR Simulator. (I think with the current release you can deploy your AIR iOS Apps on iOS Simulator as well. You get iOS Simulator in Xcode too set.) So provided you can deploy your app on AIR Mobile Simulator (Target MacOS-x86) and iPhone Simulator (iPhone-x86). What I would recommend is that you create a stub extension for default platform i.e. any platform which has no specific implementation.

See this extension as an example http://code.google.com/p/in-app-purchase-air-ios/source/browse/branches/v1/AS/src/extension.xml (Which has specific implementations for iOS and Android but has default stub for any other platform.)

And as an example of ANE AS Implementation see http://code.google.com/p/in-app-purchase-air-ios/source/browse/branches/v1/AS/src/com/adobe/nativeExtensions/AppPurchase.as here I have used Flex Conditional compilation. Basically, when I compile with device = false. I dont make any calls to native implementation. making it a stub.

See this for help on packaging ane with multiple platforms http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2482335412ffea65006-8000.html . Please post back if you have any issues.

Hope this helps.

sbhave

Inspiring
July 30, 2012

I understand that I can create a stub for MacOS-x86 (iPhone-x86 was new to me), but what I am wondering is if there is a simpler way. Based on your answers, I am guessing the answer is no. It seems like it would be a simple thing to design Flash Builder in a way that it does not package the iOS extension when running on the simulator. The simulator is not iOS or ARM, so what is the point of packaging something that is gauranteed to fail? Shouldn't the simulator be treated as either MacOS or Windows when packaging? There could be a separate target platform under "Flex Build Packaging".

July 30, 2012

Hi,

For deploying to the simulator, there's another target: iPhone-x86. You will need to include this target in your extension.xml and also using -platform switch while packaging your ANE.

You will also have to create a separate static library for the simulator(you can use the same Xcode Project and compile the .a for Simulator target).

More on this can be found at:

http://blogs.adobe.com/airodynamics/2012/05/06/using-new-simulator-support-feature-for-ios/