9 Replies Latest reply: Feb 22, 2013 2:26 PM by whyDontUCmyLogin RSS

    AIR app closes instantly on opening

    Jonnex

      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.

        • 1. Re: AIR app closes instantly on opening
          chris.campbell Employee Hosts

          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

          • 2. Re: AIR app closes instantly on opening
            Jonnex Community Member

            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.

            • 3. Re: AIR app closes instantly on opening
              chris.campbell Employee Hosts

              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

              • 4. Re: AIR app closes instantly on opening
                Adheli_Vishal

                Hi Chris and Jonnex

                Did you find out the solution?

                 

                Even i'm getting the same issue. Except that i'm not getting any errors.

                 

                When i first run my application it showed me the GUI for half second and closed. Then i tried to reopen the app its not at all showing any window.

                I does not show any errors.

                 

                I even tried enabling Crash Logging, but havent found any folder named CrashDump in my Windows folder.

                 

                If you guys found any solution please update to the forum..

                 

                Thanks

                Vishal

                • 5. Re: AIR app closes instantly on opening
                  Jonnex Community Member

                  Hi Adheli,

                   

                  Unfortunately I can't offer you much more insight than the information I wrote in my last post. The only thing I was able to track this back to (my own problem) was using a trace statement. I checked several times to assure myself that this was the problem, and found it to be 100% related to using a trace at somepoint during the application's loading.

                   

                  I can only suggest you try to remove all your trace statements; if the problem is the same one I had, this will hopefully fix your problem. If not, continue with the possible solution offered by Chris, and send him your logs.

                   

                  Good luck

                  • 6. Re: AIR app closes instantly on opening
                    chris.campbell Employee Hosts

                    Vishal, would you be willing to share your .air installer with me so I could try your app out?

                     

                    Thanks,

                    Chris

                    • 7. Re: AIR app closes instantly on opening
                      Adheli_Vishal Community Member

                      hi,

                      Sure i have sent it via yousendit.com so please you this link

                       

                      https://www.yousendit.com/download/QlVoSlIzT2JTRTQwTWRVag

                       

                      Link Expires on Jun 14 2012.

                       

                      Since the app is using native process so i have to create exe instead of air

                      • 8. Re: AIR app closes instantly on opening
                        chris.campbell Employee Hosts

                        It looks like I might have misplaced the app and the link is doead now.  Could you create a new bug report at bugbase.adobe.com and attach the application? 

                         

                        Thanks,

                        Chris

                        • 9. Re: AIR app closes instantly on opening
                          whyDontUCmyLogin Community Member

                          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.