Skip to main content
Participant
December 10, 2015
Answered

URLLoader error #2032 with AIR 20 (AIR 19 works)

  • December 10, 2015
  • 2 replies
  • 4190 views

Hello, I've updated from Flex 4.14.0 + AIR 19 build 143 to Flex 4.14.0 + AIR 20 build 206, now my code with URLLoader on a HTTP connection without SSL doesn't work on iOS (error #2032).

The device I'm testing on is an iPad Mini Retina with iOS 9.2.

The url is reachable with Safari.

Snippet is the following:

var url:String = "http://www.falcosoft.it/catalogo/catalogo.xml";

var onComplete:Function = function(event:Event):void {

  // this code doesn't get called

  loader.removeEventListener(Event.COMPLETE, onComplete);

};

var onIOError:Function = function(event:IOErrorEvent):void {

  // the program always calls onIOError with error #2032: Stream error

  loader.removeEventListener(IOErrorEvent.IO_ERROR, onIOError);

};

var onSecurityError:Function = function(event:SecurityErrorEvent):void {

  loader.removeEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

};

var request:URLRequest = new URLRequest(url);

request.method = URLRequestMethod.GET;

var loader:URLLoader = new URLLoader();

loader.dataFormat = URLLoaderDataFormat.BINARY;

loader.addEventListener(Event.COMPLETE, onComplete);

loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError);

loader.addEventListener(SecurityErrorEvent.SECURITY_ERROR, onSecurityError);

loader.load(request);

This topic has been closed for replies.
Correct answer raffo80

My bad.

I didn't see the section in the FAQ explaining that Apple is limiting access to unsecured web connections.

I'd like not to delete the question because searching for the problem on search engines didn't lead to recent answers.

I will try to add the following manifest addition to bypass the problem.

<iPhone>

<InfoAdditions>

<![CDATA[

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key><true/>

</dict>

]]>

</InfoAdditions>

</iPhone>

2 replies

Known Participant
December 14, 2015

Is there a difference with ad hoc builds and release builds regarding the loading perhaps? My ad hoc build seems to load my content just fine without the ATS additions into the app descriptor...

raffo80Author
Participant
December 14, 2015

My ad hoc build did NOT load any http content without the fix

raffo80AuthorCorrect answer
Participant
December 10, 2015

My bad.

I didn't see the section in the FAQ explaining that Apple is limiting access to unsecured web connections.

I'd like not to delete the question because searching for the problem on search engines didn't lead to recent answers.

I will try to add the following manifest addition to bypass the problem.

<iPhone>

<InfoAdditions>

<![CDATA[

<key>NSAppTransportSecurity</key>

<dict>

<key>NSAllowsArbitraryLoads</key><true/>

</dict>

]]>

</InfoAdditions>

</iPhone>

Adobe Employee
December 10, 2015

Hi,

App Transport Security (ATS) is being introduced from Apple in iOS9, which doesn’t allow unsecure connections between App and Web services. Due to this change all the connections which are made to unsecure web sites via Loader, URLLoader will discontinue and not work due to App Transport Security. Please specify exceptions to the default behavior by adding keys to InfoAdditions tag of application descriptor of your app.  

<key>NSAppTransportSecurity</key>

  <dict>

  <key>NSAllowsArbitraryLoads</key><true/>

  </dict>

Same has been mentioned in : http://fpdownload.macromedia.com/pub/labs/flashruntimes/shared/air20_flashplayer20_releasenotes.pdf

Roshan

Adobe AIR