6 Replies Latest reply on Nov 26, 2014 6:18 AM by DuncanBe11

    Repeatable compiler crash when exporting release build

    YNAB Level 1

      When I'm exporting one of my projects as a release build, I'm getting the following crash. Whether I execute the command in the IDE or from the command line (via an ant build) I get the same crash. Has anyone else seen this before?
         - Taylor
      [06:17:36]: BUILD FAILED
      [06:17:36]: java.lang.NullPointerException
      [06:17:36]: at com.adobe.flexbuilder.util.FileCopy.listFilesRecursively(FileCopy.java:223)
      [06:17:36]: at com.adobe.flexbuilder.util.FileCopy.run(FileCopy.java:94)
      [06:17:36]: at com.adobe.flexbuilder.exportimport.releaseversion.ExportReleaseVersionManager$2.execute(E xportReleaseVersionManager.java:317)
      [06:17:37]: at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModifyOperation.java:106)
      [06:17:37]: at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975)
      [06:17:37]: at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOperation.java:118)
      [06:17:37]: at com.adobe.flexbuilder.exportimport.releaseversion.ExportReleaseVersionManager.doBuild(Exp ortReleaseVersionManager.java:355)
      [06:17:37]: at com.adobe.flexbuilder.exportimport.ant.ExportReleaseBuildTask.doBuild(ExportReleaseBuildT ask.java:192)
      [06:17:37]: at com.adobe.flexbuilder.exportimport.ant.ExportReleaseBuildTask.doit(ExportReleaseBuildTask .java:166)
      [06:17:37]: at com.adobe.flexbuilder.exportimport.ant.ExportReleaseBuildTask.execute(ExportReleaseBuildT ask.java:88)
      [06:17:37]: at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
      [06:17:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [06:17:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      [06:17:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      [06:17:37]: at java.lang.reflect.Method.invoke(Unknown Source)
      [06:17:37]: at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
      [06:17:37]: at org.apache.tools.ant.Task.perform(Task.java:348)
      [06:17:37]: at org.apache.tools.ant.Target.execute(Target.java:357)
      [06:17:37]: at org.apache.tools.ant.Target.performTasks(Target.java:385)
      [06:17:37]: at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
      [06:17:37]: at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
      [06:17:37]: at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
      [06:17:37]: at org.eclipse.ant.internal.core.ant.EclipseDefaultExecutor.executeTargets(EclipseDefaultExe cutor.java:32)
      [06:17:37]: at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
      [06:17:37]: at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:662)
      [06:17:37]: at org.eclipse.ant.internal.core.ant.InternalAntRunner.run(InternalAntRunner.java:534)
      [06:17:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [06:17:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      [06:17:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      [06:17:37]: at java.lang.reflect.Method.invoke(Unknown Source)
      [06:17:37]: at org.eclipse.ant.core.AntRunner.run(AntRunner.java:513)
      [06:17:37]: at org.eclipse.ant.core.AntRunner.start(AntRunner.java:600)
      [06:17:37]: at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
      [06:17:37]: at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLau ncher.java:110)
      [06:17:37]: at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.jav a:79)
      [06:17:37]: at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
      [06:17:37]: at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
      [06:17:37]: at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [06:17:37]: at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
      [06:17:37]: at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
      [06:17:37]: at java.lang.reflect.Method.invoke(Unknown Source)
      [06:17:37]: at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:619)
      [06:17:37]: at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
      [06:17:37]: at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
      [06:17:37]: Total time: 6 minutes 14 seconds
      [06:17:38]: FlashBuilderC:
      [06:17:38]: An error has occurred. See the log file
      [06:17:38]: C:\TeamCity\buildAgent\work\b9f20a43bc80d9b3\BuildMachineWorkspace\.metadata\.log.
      [06:17:38]: Process exited with code 13

        • 1. Re: Repeatable compiler crash when exporting release build
          YNAB Level 1

          Well, I don't know the exact cause, but I do know a fix:

          I had a Flash Project called YNABCSS whose main MXML application file was also called YNABCSS.mxml. I renamed the mxml file to be Test.mxml and it worked just fine. The name didn't matter because the project is only there so I can compile a .css file to .swf when the project gets built. Hopefully this will come up in someone else's Google search.

          • 2. Re: Repeatable compiler crash when exporting release build
            Anirudh Sasikumar Adobe Employee

            Can you describe your project structure in more detail?

             

            P.S: YNAB, Flash Builder does not support having a project without an Application file (MXML/AS). If you only want the Runtime CSS file, then what you have done as a workaround is the recommended approach.

             

            -Anirudh

            • 3. Re: Repeatable compiler crash when exporting release build
              YNAB Level 1

              Well, I thought that fixed it, but now I'm still getting this crash in the FileCopy.listFilesRecursively function, and it's occasionally happening with other projects too. It appears to be quite random:

               

              [06:17:36]: BUILD FAILED

              [06:17:36]: java.lang.NullPointerException

              [06:17:36]: at com.adobe.flexbuilder.util.FileCopy.listFilesRecursively(FileCopy.jav a:223)

              [06:17:36]: at com.adobe.flexbuilder.util.FileCopy.run(FileCopy.java:94)

              [06:17:36]: at com.adobe.flexbuilder.exportimport.releaseversion.ExportReleaseVersio nManager$2.execute(ExportReleaseVersionManager.java:317)

              [06:17:37]: at org.eclipse.ui.actions.WorkspaceModifyOperation$1.run(WorkspaceModify Operation.java:106)

              [06:17:37]: at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1975 )

              [06:17:37]: at org.eclipse.ui.actions.WorkspaceModifyOperation.run(WorkspaceModifyOp eration.java:118)

              [06:17:37]: at com.adobe.flexbuilder.exportimport.releaseversion.ExportReleaseVersio nManager.doBuild(ExportReleaseVersionManager.java:355)

               

              I wish I knew at what points it did this FileCopy (line 317 of ExportReleaseVersionManager.java). That would tell me where the problem might be. Any chance you could help me know where to look?

              • 4. Re: Repeatable compiler crash when exporting release build
                Anirudh Sasikumar Adobe Employee

                The code in that file is trying to enumerate files in the output directory (via File.listFiles()). From the log, it looks like this is being called on a file rather than a folder.

                 

                What is your output directory set to?

                • 5. Re: Repeatable compiler crash when exporting release build
                  YNAB Level 1

                  We have the output folder set to bin-release.

                  I finally figured out the issue. Sometimes after opening the workspace in Flash Builder, I could get everything working, but then when I would sync down my projects and workspace from source control, this pesky bug would come back. By comparing the folder structure of the working version with that of the one that gave me the above exception, the only notable difference is that the broken version was missing some bin-release and bin folders. This seemed perfectly fine to me, as I assume those folders always get created as part of a compilation. However, adding them back in causes my YNABCSS project not to fail anymore. I should note that adding these folders to the YNABCSS project was not sufficient. It appeared I had to add them to its dependent projects as well. I didn't take the time to determine exactly which project needed this bin or bin-release folder. Once I was done adding all of the missing folders and saw that fixed it, I decided to move on. In any case case, adding in missing bin and bin-release folders to just about every project in my workspace did cause it start building again.

                   

                  So, with that out of the way, I have a working build machine based on TeamCity: I can finally create a workspace in Flash Builder with all of my projects, check the workspace in to source control, and then make sure my build machine checks out the folder into a known location (since the Flash Builder workspace unfortunately uses absolute paths), and then kick off a build by pointing FlashBuilderC.exe to this source-controlled workspace folder. It unfortunately took me way too much time, but I was glad to see it work.

                   

                  On a related note, it is quite hard to set up Build Machine automation (read: Continuous Integration) for projects in Flash Builder! Due to the absolute paths in workspaces, this is a non-trivial task that is extremely finicky. I've been happy with Flash Builder, but this is one place where it pales in comparison to Visual Studio. In that environment, I only need to have a .sln file that relatively points to its child projects. It is a much easier way to set it up for deployment to build machines (or to other developers for that matter).

                   

                  I would love to see Flash Builder adopt a similar relative-path model for specifying project locations.

                  • 6. Re: Repeatable compiler crash when exporting release build
                    DuncanBe11

                    I was having the same issue as described above when doing automated builds using FlashBuilderC. Our source code is checked out via SVN in a directory outside of the various workspaces (one for each branch and trunk).

                     

                    To resolve I created a new work space for the branch in question and added references to the projects in the source code directory.