• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

Air for iOS SDK 25 XML/ JSON Problem.

New Here ,
Mar 30, 2017 Mar 30, 2017

Copy link to clipboard

Copied

Hi everyone.

First of all sorry for my english 😕

I have been working with Adobe Air a long time but lately I´m facing some issues with the latest releases of the SDK.

The problem is displaying data from xml or json objects, everything works fine with Air SDK 17 but when I test on some recent releases always displays an error, not even load the data at all.

I don´t know if it is a bug or something like that, the code works perfect but as I mentioned fails to load on the resent releases of the SDK.

If anyone have a solution for this will be highly appreciated.

TOPICS
Development

Views

853

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Contributor , Apr 03, 2017 Apr 03, 2017

OK how about testing for a Security Error:

xmlLoaderA.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

private function securityErrorHandler(event:Event):void {

   trace("************ XML SECURITY ERROR *************");

   trace("SECURITY error occured with " + event.target);

}

Also, have you added the now required NSTransportSecurity XML to your iOS app descriptor as described here:

actionscript 3 - Flash CS6 - AS3 - Check internet connection not working at all - Stack Overflow

...

Votes

Translate

Translate
Contributor ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

Can you show the code that is failing?

I am loading XML in AIR 25 SDK and it works fine.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

Is it working on the device? because on emulator runs normal and everything works.

The code I´m using.

LoadPlaylist("Some URL");

private function LoadPlaylist(Uri:String):void{

  xmlLoaderA = new URLLoader();

  xmlLoaderA.addEventListener(Event.COMPLETE, onCompleteA);

  xmlLoaderA.addEventListener(IOErrorEvent.IO_ERROR, onError);

  xmlLoaderA.load(new URLRequest(Uri));

  }

private function onCompleteA(e:Event):void {

     //Do Something

}

I have tested with SDK 21,22,23,24,25 currently working with SDK 17 for iOS. on Android is working.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

Do you get anything if you put a trace statement inside the onError handler (not shown in your code)?

private function ioErrorHandler(event:Event):void {

   trace("************ XMLERROR *************");

   trace("errorHandler: " + event);

}

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

Yes, sorry I forgot that.

This is the error: Error #2032: Stream Error. URL: "Same URL"

But the url is fine and working.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

Why not try listening for flash.events.HTTPStatusEvent.HTTP_RESPONSE_STATUS?

flash - Error #2032: Stream Error - Stack Overflow

  xmlLoaderA.addEventListener(HTTPStatusEvent.HTTP_STATUS, httpStatusHandler);

private function httpStatusHandler(event:HTTPStatusEvent):void {

  trace("httpStatusHandler: " + event);

  trace("status: " + event.status);

  }

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

On SDK 25 got this

httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=0 redirected=false responseURL=null]

status: 0

on SDK 17

httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=200 redirected=false responseURL=null]

status: 200

not sure what to do.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

Are you using a secure connection for the URL, https not http?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 31, 2017 Mar 31, 2017

Copy link to clipboard

Copied

No, I'm using only http. But is the same with https thats why I guess is a bug from the latest releases.

Going ahead testing with a simple php chat is the same connection error.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

OK how about testing for a Security Error:

xmlLoaderA.addEventListener(SecurityErrorEvent.SECURITY_ERROR, securityErrorHandler);

private function securityErrorHandler(event:Event):void {

   trace("************ XML SECURITY ERROR *************");

   trace("SECURITY error occured with " + event.target);

}

Also, have you added the now required NSTransportSecurity XML to your iOS app descriptor as described here:

actionscript 3 - Flash CS6 - AS3 - Check internet connection not working at all - Stack Overflow

(Search the page for the text "Also, have you added the now required NSTransportSecurity XML to your iOS app descriptor")

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 03, 2017 Apr 03, 2017

Copy link to clipboard

Copied

Genius!!! Thanks a lot I did not know about the NSTransportSecurity requirement now is working!!!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Apr 04, 2017 Apr 04, 2017

Copy link to clipboard

Copied

LATEST

Glad to hear it's working for you.

That's why I asked about the http/https connection. If you do not edit your application descriptor xml file to include the NSTransportSecurity bit, you need to connect over https and the server must have a valid certificate.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines