0 Replies Latest reply on Dec 7, 2011 3:23 PM by CEDixon

    Native Extensions - Can iOS use the default platform?

    CEDixon

      Please let me know if this should go somewhere else, I'm not sure if it should go here or the Flash Builder forum.

       

      I'm running Flex 4.6.  I have a mobile application that runs in both android and ios.

       

      I wrote a native extension for android that allows us to tap into the device's bluetooth and read from a connected external GPS.

       

      This will NEVER work in ios, since the particular bluetooth used by the GPS is not supported.

       

      I added the default platform to the extension so I could run in the emulator, along with the Android-ARM

       

      In the mobile application, I added the ane to the Flex Build Path where it has a big ol' X next to it and says "This ANE does not support Apple iOS platform".

       

      I then added the ANE to the Flex Build Packaging for just Android.

       

      Everything's ok when I run android or the emulator.  I also have Capabiliites.os checks around where I use the code to make sure if I'm not on android, it doesn't get called.

       

      When I build OS, of course everything goes wrong.  I tried including the ANE in the package and I get this:

       

      Error occurred while packaging the application:

       

      Warning: Using default implementation for native extension 'com.threegis.NavcomStarfireBluetooth'

       

      Exception in thread "main"

       

      If I don't include the package and check "Ignore Errors", I get:

       

      Some classes used in the application could not be resolved for packaging.  See error log for more details.

       

      Is there any way around having to write a native library for iOS and include it in the ANE?  Since the functions are never called, all I need are empty functions, I think.  Still, I'd rather it just used the default platform and didn't worry about it, since none of the functions will be called anyway.