Skip to main content
Participant
February 7, 2012
Answered

AIR app closes instantly on opening

  • February 7, 2012
  • 9 replies
  • 4358 views

Hi all,

I've built and depolyed AIR apps before, and never had any problems, but the app I'm working on right now is really causing me some trouble.

I built the app in Flash Builder, and exported it using the 'Export Release Build' dialogue; I chose 'Signed AIR package', everything went fine there. I installed the app to a directory on my desktop, and no errors were thrown during the installation.

Double clicking the .exe file opens the app window momentarily, then it instantly closes without any other errors or exceptions being thrown. I tried opening the included SWF in the Flash debug player, but it stops on an exception like this:

VerifyError: Error #1014: Class flash.events::NativeWindowBoundsEvent could not be found.

Which is just because I'm using an AIR API call that's unsupported by the Flash player.

I've tried using Process Monitor to see if there are any errors when the app starts, but I can't really make all that much sense of what it reports. The only slightly suspect entries were ones with 'NAME NOT FOUND' and 'OPLOCK NOT GRANTED', but there was no info included that gave me any ideas about what is causing the problem.

Anyone any ideas, I'm totally stuck.

This topic has been closed for replies.
Correct answer Jonnex

Hi Chris,

Thanks a lot for your reponse. I tried the thing you suggested, but strangely no folder by that name (in the other thread you linked) existed, before or after the app crashed. I tried a few other things, like running the AIR app through the ADL, to see if that would produce the error log you were describing.

I got an error when using the ADL, 'initial content not found'. I thought maybe some of the assets weren't being loaded correctly, so I went through and put in loads of logging, using the SOS Max Logger. Whilst doing this, I decided to remove a trace() statement I had, or rather change it so it used the logger. This is what I changed:

From this:

trace("Load Progress: " + event.target.progress);

To this:

logger.debug("Load Progress: " + event.target.progress);

The event is a LoaderEvent, from the LoaderMax lib. After this change, the app worked after installation. I had to then back-track through all my changes to see what caused it, and found that this was it.

I'm a bit dumbfounded as to why this caused the problem. I still have other trace() statements in there, that cause no problems at all. Seemingly it's having the event.target.progress thing in there that makes the difference.

Anyway, thanks for your help Chris.

9 replies

Participant
February 22, 2013

I just did the same thing.

The build was crashing.  I traced the bug to a trace() command.

However, mine did not have any progress event attached to it.

if (level == LogLevel.ERROR)

                {

                    trace("*** Error:" + msg + " ***");

                }               

                else if (debugMode)

                {

                    trace("message: " + msg);

                }

When I commented out the two trace() commands above, the app compiled.

chris.campbell
Legend
February 7, 2012

Hi Jonnex,

Could you try enabling automatic dump file creation and try launching your app again to see if it's actually crashing?  If it is, please send me the dmp file (ccampbel@adobe.com).  I'd also be happy to try this myself if you'd like to just send me the .air file instead.

See this post for .reg files to enable/disable dump file creation.

http://forums.adobe.com/message/4159755#4159755

Thanks,

Chris

JonnexAuthorCorrect answer
Participant
February 8, 2012

Hi Chris,

Thanks a lot for your reponse. I tried the thing you suggested, but strangely no folder by that name (in the other thread you linked) existed, before or after the app crashed. I tried a few other things, like running the AIR app through the ADL, to see if that would produce the error log you were describing.

I got an error when using the ADL, 'initial content not found'. I thought maybe some of the assets weren't being loaded correctly, so I went through and put in loads of logging, using the SOS Max Logger. Whilst doing this, I decided to remove a trace() statement I had, or rather change it so it used the logger. This is what I changed:

From this:

trace("Load Progress: " + event.target.progress);

To this:

logger.debug("Load Progress: " + event.target.progress);

The event is a LoaderEvent, from the LoaderMax lib. After this change, the app worked after installation. I had to then back-track through all my changes to see what caused it, and found that this was it.

I'm a bit dumbfounded as to why this caused the problem. I still have other trace() statements in there, that cause no problems at all. Seemingly it's having the event.target.progress thing in there that makes the difference.

Anyway, thanks for your help Chris.

chris.campbell
Legend
February 9, 2012

That is very odd.  I'm not sure why that's happening but I'll ask around and see if anyone knows.  Glad you figured it out though!

Chris