Rod Perkins
Mon, 26 Mar 2007 10:31:42 -0800
I encountered a problem with FlexBuilder 2.0.1 that stymied me for
a few days. The compiler was reporting "An internal build error has
occurred. Please check the Error Log." The error was not attached
to any specific line number within my code. This was after several
changes to my program which I judged to be cosmetic changes.
My first problem was that I could not locate the Error Log the
message referred to, and there was little information available on
the web on this error.
I had a similar problem a few days ago and got advice to re-installl
my Flex environment. Fearing a recurring meltdown of my Flex
environment and wanting to avoid another re-install, I retraced
my "cosmetic" changes and discovered the problem was using an If
statement to skip a code block containing trace statements,
effectively commenting out the code.
I extracted a simple Actionscript 3.0 example that illustrates the
problem:
package
{
import flash.display.Sprite;
import flash.events.*;
public class BuildError extends Sprite
{
private function netStatusHandler( event :
NetStatusEvent ):void
{
var flvVideo : Object = null;
// This line is used to skip the control block based on the
Boolean
if (true)
{
// This line will print "<><> netStatusHandler: null"
trace("<><> netStatusHandler: " + event );
// This if statement causes the compiler problem.
// To trigger the problem:
// 1. Change the previous "if (true)" to "if
(false)". This
// will cause the Problem window to report "An
internal build error
// has occurred. Please check the Error Log."
// 2. A secondary problem is that if the "if
(flvVideo != null)" line
// is changed to "// if (flvVideo != null)",
effectively commenting out only
// the if statement, the internal error is
removed, and the problem
// area now reports "1131: Classes must not be
nested".
if (flvVideo != null)
{
trace( "..." + flvVideo.videoWidth + "," +
flvVideo.videoHeight );
}
}
}
public function BuildError()
{
netStatusHandler( null );
}
}
}
Needless to say, this should not generate any errors whatsoever, or
cause a shutdown of the compilier. Additionally, the generated
error message should be descriptive, and the error log is to find.