0 Replies Latest reply on Dec 22, 2010 4:18 PM by sfichel

    Another Compiler Bug (message: An internal build error has occurred... Unknown Flex Problem)

    sfichel

      I was fighting with this problem for a few days. Finally I've got it resolved. I want to describe it and fill in BUG in the bug report, but I am not sure about Adobe support options. So, I am putting bug report here.

       

      1. ASSUMPTION: All problems which compiler reports as unknown problem are the real compiler BUGs/Problems. Eventually MXML compiler/ActionScript compiler should be able to take C++ or FORTRAN code or an aribitrary text and nicely tell "Error: It is not ActionScript (Flex) code" or "the code is corrupted from Line so and so...". When compiler crashed, it is most probably due to one of the states not handled (or not handled correct). Keeping this in mind I assume, that my code has nothing to do with the compiler crash.

       

      2. PROBLEM Description.

       

           - I tried to port our internal project from Flex3.5/Flex Builder 3 to Flex4.1/Flash Builder 4.

           - After checking out and trying to build code I start getting weird problems like Error 1037: Packages cannot be nested.

           - After cleaning and compiling project by project, walking up dependency tree, I was able to get rid of this problem.

           - On last Project I've got another problem (An internal build error has occurred... Unknown Flex Problem). Which I stuck with for a while.

           - When I checked log file I found following messages:

       

      ============================================================

       

      !ENTRY com.adobe.flexbuilder.project 4 43 2010-12-21 15:45:24.353
      !MESSAGE Uncaught exception in compiler
      !STACK 0
      java.lang.ClassCastException: macromedia.asc.parser.InputBuffer cannot be cast to flex2.compiler.as3.CodeFragmentsInputBuffer
      at flex2.compiler.as3.AbstractSyntaxTreeUtil.lineNumberToPosition(AbstractSyntaxTreeUtil.jav a:1266)
      at flex2.compiler.mxml.ImplementationGenerator.generateBinding(ImplementationGenerator.java: 569)
      at flex2.compiler.mxml.ImplementationGenerator.generateBindingsSetupFunction(ImplementationG enerator.java:863)
      at flex2.compiler.mxml.ImplementationGenerator.generateBindingsSetup(ImplementationGenerator .java:812)
      at flex2.compiler.mxml.ImplementationGenerator.generateInitializerSupportDefs(Implementation Generator.java:1878)
      at flex2.compiler.mxml.ImplementationGenerator.generateClassDefinition(ImplementationGenerat or.java:1044)
      at flex2.compiler.mxml.ImplementationGenerator.<init>(ImplementationGenerator.java:206)
      at flex2.compiler.mxml.ImplementationCompiler.generateImplementationAST(ImplementationCompil er.java:499)
      at flex2.compiler.mxml.ImplementationCompiler.parse1(ImplementationCompiler.java:197)
      at flex2.compiler.mxml.MxmlCompiler.parse1(MxmlCompiler.java:168)
      at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2871)
      at flex2.compiler.CompilerAPI.parse1(CompilerAPI.java:2824)
      at flex2.compiler.CompilerAPI.batch2(CompilerAPI.java:446)
      at flex2.compiler.CompilerAPI.batch(CompilerAPI.java:1274)
      at flex2.compiler.CompilerAPI.compile(CompilerAPI.java:1496)
      at flex2.tools.oem.Application.compile(Application.java:1188)
      at flex2.tools.oem.Application.recompile(Application.java:1133)
      at flex2.tools.oem.Application.compile(Application.java:819)
      at flex2.tools.flexbuilder.BuilderApplication.compile(BuilderApplication.java:344)
      at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder$MyBuilder.mybuild(A SApplicationBuilder.java:276)
      at com.adobe.flexbuilder.multisdk.compiler.internal.ASApplicationBuilder.build(ASApplication Builder.java:127)
      at com.adobe.flexbuilder.multisdk.compiler.internal.ASBuilder.build(ASBuilder.java:190)
      at com.adobe.flexbuilder.multisdk.compiler.internal.ASItemBuilder.build(ASItemBuilder.java:7 4)
      at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.buildItem(FlexProjectB uilder.java:480)
      at com.adobe.flexbuilder.project.compiler.internal.FlexProjectBuilder.build(FlexProjectBuild er.java:306)
      at com.adobe.flexbuilder.project.compiler.internal.FlexIncrementalBuilder.build(FlexIncremen talBuilder.java:157)
      at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:633)
      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:170)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:201)
      at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:253)
      at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:37)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:256)
      at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:218)
      at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:360)
      at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:516)
      at org.eclipse.core.internal.resources.Project.build(Project.java:94)
      at org.eclipse.ui.actions.BuildAction.invokeOperation(BuildAction.java:221)
      at org.eclipse.ui.actions.WorkspaceAction.execute(WorkspaceAction.java:162)
      at org.eclipse.ui.actions.WorkspaceAction$2.runInWorkspace(WorkspaceAction.java:483)
      at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38 )
      at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
      !SESSION 2010-12-22 09:48:27.766 -----------------------------------------------
      eclipse.buildId=M20100909-0800
      java.version=1.6.0_16
      java.vendor=Sun Microsystems Inc.
      BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
      Framework arguments:  -product org.eclipse.epp.package.jee.product
      Command-line arguments:  -data C:\Client_Flex4 -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.jee.product

       

      ================================================

       

      3. RESOLUTION/WORK AROUND

       

           - I was able to get this problem cleared by putting compiler option for Flex Application projects:  -keep-generated-actionscript

       

      4. SIDE NOTE

       

        I do not really see putting this compiler option as the solution and living with the mistery is making me fill a bit bad.