tags:

views:

203

answers:

2

Whenever I debug my AIR app it keeps suspending at a certain line of code...it doesn't give me a reason why, it just says Main Thread (Suspended) No error, no breakpoint at this location either. If I comment out the code so that, that line does not execute, it just does the same thing on a different line of code.

I have no clue why.... What should I do?

Thanks!!

Here is the function it happens in:

public function update (): void
     {
      dispatchEvent ( new Event ( EVENT_UPDATE_DOWNLOAD_STARTED ) );

      var request: URLRequest = new URLRequest ( _newVersionUrl );
      urlStream = new URLStream();
      updateFileData = new ByteArray();
      urlStream.addEventListener ( Event.COMPLETE, streamDownloadComplete );
      urlStream.addEventListener ( ProgressEvent.PROGRESS, streamDownloadProgress );
      urlStream.addEventListener ( IOErrorEvent.IO_ERROR, versionCheckIOErrorHandler );
      urlStream.load(request);
     }

this is the line it suspends on:

updateFileData = new ByteArray();

updateFileData is defined outside the function like so:

protected var updateFileData: ByteArray;

I should mention...this code is the code that Updates the version of air..could this be suspending because its trying to update while in adl.exe?

Thanks

A: 

Are you using FlexBuilder? If you are, have you made sure there isn't a breakpoint set somewhere in your SDK source (I sometimes do this by mistake)? Try checking, via the Debugging profile (Window > Perspective > Flex Debugging), the the Breakpoints view to see whether there's anything in there you don't recognize. Also, when you're hung up, try stepping through the code (e.g., using F5 or F6) to see if that helps you figure out where the debugger's stopped.

Christian Nunciato
Yes I am using FB3, I checked debug perspective for any break-points and didn't see any..I do not know how to spot break-points other than those blue dots though.
John Isaacks
What happens when you're "suspended" and then hit F6 (to skip over)? Do any files open, or does your view change at all, to indicate where the debugged might be hung up? Also, does the Debug tab show a stack trace of any kind?
Christian Nunciato
A: 

Not 100% sure, because you're not hitting the error but - This might be an issue caused because the docs say you can't do the update while in the debugger:

When testing an application using the AIR Debug Launcher (ADL) application, attempting to update the application results in an IllegalOperationError exception.

This is from the livedocs.

Gabriel
I think this has to do with it, I changed the version number for the app I am working on to be higher than the update's version number so now it is not trying to update and its not happening now.
John Isaacks
I think the big test is - does it lock outside the debugger? If it does not - then I think you're certainly hitting an issue with the update under debugger issue.
Gabriel
When I export it as a .air and installed/run it it works fine. So yes I think this is the issue.
John Isaacks
Yep, I similar issues myself... IMHO it sucks that the 'update' stuff has the non-debug scenario strange limitation.
Gabriel