Skip navigation
Currently Being Moderated

Adobe: What frameworks are compatible with Native Extensions on iOS?

Apr 25, 2012 4:19 PM

Tags: #air_for_ios #air_native_extensions

Man it's really hard to diagnose what could possibly be going wrong compiling ANEs for iOS. I dev apps in Xcode that work perfect, zero leaks. I use any part of the majority of the frameworks I've tried (none visual) and they simply don't work outside a very rare few. Vibration, gyroscope, alert modals, etc.

 

Is there a list of compatibility between ANEs and classes on platforms that AIR supports? Whether it be Windows, iOS, Android, MacOSX, etc?

 

Is there some way to "know" that a framework should be supported? For example, all I remember reading is to steer clear of visual classes. Oddly the UIAlertView modal works on iOS (that's visual to me but *shrug*).

 

My current need is to use NSURLConnection and NSURLRequest. Both are in Foundation.h. Neither are visual. They're simply classes that make a connection to a host while sending and receiving responses. Yet any time I attempt to instantiate a NSURLRequest it's insta-crash. I comment it out and the ANE works fine. So far I find almost everything I do with ANEs to fail.

 

Clearly the framework classes I'm using aren't supported or I'm doing it miserably wrong.

 

A chart indicating support would be REALLY nice for each platform.

 

On another note, has anyone utilized NSURL* on iOS successfully in an ANE?

 
Replies
  • Currently Being Moderated
    May 2, 2012 7:30 AM   in reply to sinious

    In my experience (which is pretty limited) an insta-crash could mean:

    • The framework was not properly linked in when the ANE was created (ex. You're using a non-standard .framework and adt doesn't know where to find it.)
    • The iOS Build Packaging preferences (for your AIR project) don't know where the Apple iOS SDK's base directory is. (This can be an easy one to forget.)

     

    I assume you've already ruled both of those out but just in case I thought I'd mention them.

     
    |
    Mark as:
  • Currently Being Moderated
    May 2, 2012 8:28 AM   in reply to sinious

    Like you, I also only used ADT from the command line to package the ANE. For everything else I have been using Flash Builder. I don't know, off the top of my head, why Flash Builder requires the base-directory for your iOS SDK. I only know that my app instantly crashed until I realized I had forgotten to specify that base directory. (Your mileage may vary, though.)

     

    I'm not an Objective-C wizzard by any means. I know enough to get by but it's not a strong point. Maybe others will see some chatter on this thread and chime in.

     

    Thanks so much for the link to the Xcode debugging article. I believe that will help me greatly, going forward.

     
    |
    Mark as:
  • Currently Being Moderated
    May 9, 2012 2:54 PM   in reply to sinious

    Very interested in this topic and would love to know if you get an answer to your original question.  Did you resolve this yet?

     

    I've been using Adobe Native Extensions for Native Alerts and NetworkInfo.  I'd like to find more information on why native iOS visual classes can't be used in an ANE.  Do you know why specifically?

     
    |
    Mark as:
  • Currently Being Moderated
    May 10, 2012 10:38 AM   in reply to sinious

    interesting.  I'm using the native alert just fine...i've also implemented an alert in AS, and it feels like the native alert is faster.

     

    I just found this StackOverflow article on displaying a display in an ANE:

    http://stackoverflow.com/questions/8968726/how-to-create-an-ane-that-w ill-natively-display-a-floating-window/8974888#8974888

     
    |
    Mark as:
  • Currently Being Moderated
    May 10, 2012 11:16 AM   in reply to sinious

    our product is continually limited by Flash running on iOS.  However, there's things we need in Flash (real-time streaming video) that we can't easily duplicate on native iOS code.  However, for the rest of our app (social login, event browsing etc.), we don't need Flash, so we're considering writing our whole app in native iOS, packaging that into an ANE, and then have Adobe Air launch and immediately load the ANE.

     

    native iOS code runs faster than the Flash equivalent on iOS for every instance I've tested.  Pop-up alerts, lists, buttons, view transitions, etc.  Everything runs faster natively.  Sure, the difference is usually small, but by no means negligible.  And yes, our users absolutely notice.  Native iOS code is multi-threaded, while the Flash Air runtime is not, and this has a big effect on display rendering, at least in all our development and testing.

     
    |
    Mark as:
  • Currently Being Moderated
    May 10, 2012 12:12 PM   in reply to sinious

    I haven't specifically implemented NSURLRequest in an ANE.  However, the EXC_BAD_ACCESS error is happening because you're referencing a deallocated instance, so I'm not sure that error is related to not being able to access the underlying class framework.  If it were, it would have thrown up sooner.  Your call stack seems to execute fine until you try to reference the length of your string.  That's when it throws EXC_BAD_ACCESS.  Have you tried forming a string object explicitly instead like this?:

     

    1. NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithString:@"http://www.google.com"]]
    2.                                                 cachePolicy:NSURLRequestUseProtocolCachePolicy
    3.                                             timeoutInterval:60.0];

     

    Not sure that would help but that's what I would try.  actually from this article seems it shouldn't make a difference: http://stackoverflow.com/questions/3681133/objective-c-string-differen ces

     

     

    I'm not sure what you mean by "Air is no longer AIR" when the IPA is compiled.  From my understanding, the FlashBuilder IDE compiles both the application code and the Adobe AIR runtime down into the IPA.  At that point, it's bytecode running on the device, but it's still "AIR", just compiled down to run on the device.  However, since Flash/AIR is designed as a single-threaded runtime environment (this is well documented across the web), then the device doesn't make use of multi-threading when running the app, since there is no instruction within the bytecode on how to achieve this.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 13, 2013 2:56 AM   in reply to sinious

    Hi,

    have you ever resolved EXC_BAD_ACCESS error with NSURL*?

    I'm investigating possibility of using Client Certificate Authentication on iOS from AIR and this is the only meaningful thread I've come around by now.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 19, 2013 11:45 AM   in reply to sinious

    Just stumbled across this thread.  In terms of native extensions that are visual, can you point me to more info on that?  I have had wierd issues and thinking it might be native UI Extension on iOS causing it since it is used throughout.  Would like to understand if this is the issue.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points