Wednesday, February 21, 2007

Internal Build Error

I recently ran into an issue with Flex Builder where I was getting the "An internal build error has occurred. Please check the Error Log." error when trying to debug my project. Absolutely nothing worked including all the normal practices such as cleaning the project, recreating the workspace, manually deleting the bin folder, reinstalling Flex Builder, etc.

After performing all of these tasks I was still getting "Uncaught exception in compiler" in the error log, which by the way is the .log file in the .metadata folder of your workspace. After further analysis, I tied the issue back to a missing semi-colon after a variable declaration in my class such as:

public class SomeClass
{
      public var blah:Object
}

If you ever find yourself in this situation, start rolling back code and begin to do a detailed analysis for syntax errors that normally do not pose any problems.

17 comments:

Anonymous said...

Great post! You fixed my issue right away! You can't skip a ; before an attribute declaration!

Thanks!
Michael

Jules said...

Handy post, I needed to find the .log file and didn't want to trawl the Adobe livedocs/labs knowledge soup.

I just had the same error (Uncaught exception in .log, java.lang.StackOverflowException). It appeared after I'd done some work with sed on my object model. Turned out one of the classes extended itself, ie class myClass extends myClass :-)

This was with the Flex 3 Beta.

Cheers
Jules

ps the link to my site goes nowhere yet -- still to come! Let's just say I am in "stealth mode" heh

Damian said...

Great Article.

Also, I once got this error when nesting three if statements. It was the wierdest thing.

20after4 said...

Thanks for the tip - I was searching everywhere for that log file!

It turns out, in my case anyway, that the internal build error can also happen if you are running eclipse in GCJ instead of sun java.

I added this to my Flex startup script to fix it:

JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun/
PATH=/usr/lib/jvm/java-1.5.0-sun/bin/:$PATH

Anonymous said...

Excellent!!!
The offending snippet was
private var o : Object = (data='A',label="A");


Thanks a lot.

Anonymous said...

Just like Jules, I wanted to locate the log file - soooo glad you mentioned where it is - thanks!!

Googling the "An internal error..." message is what got me to this page.

shi11 said...

nice post! my error was caused by improperly commenting out a line in an overridden puremvc function.

Neil said...

the missing semi colons are probably on a line before a metatag

eg

private var _myVar:String

[Bindleable]

otherwise the compiler thinks the [] belong to the prievious line

omkar said...

I also had the error saying "An internal build error has occurred. Please check the Error Log."
I did all the painful debugging of the code.
I edited a mxml and the above problem start coming. But then i copied the contents of the mxml file on to a notepad. i deleted all .html , .swf and also the dubug file relevant to aboce mxml. Then i took the new mxml file and copied the contents of the notepad.
The file ran finely.
Try to do this. It may help you people

Have a good day

metaine said...

You can also get this error by creating switch() {} statement without any case ... break construction inside it. Just've found this issue. Thanks for your very helpful posting!

aditya said...

This is so informative a post that I have bookmarked it in my firefox.

Also, sometimes creating the 'bin' folder is important as Flex 3 compiler doesn't check if it is already present or not. It assumes that 'bin' folder would already be magically there.

Anonymous said...

Here's another syntax error that leads to an uncaught compiler error. If you look in the log (which you can find if you right-click on the error message in the "Problems" window of the Flex Builder and follow the instructions), you will see the message

java.lang.NumberFormatException: multiple points

the offending code is

public var springFriction:Numner = 0.5.

Now that's a syntax error the compiler definitely should have caught! Too bad I had to rip apart my project to find it.

Thanks for making this thread a google-able repository of stupid Flex compiler bugs, you're saving people a lot of time.

Karfau said...

Another source for this bloody error:
I had a properties-file wich I created in ANSI format. it didn't metter what I tried to change the format: the error stayed.

The Message from the log:
!MESSAGE Uncaught exception in compiler
!STACK 0
java.lang.StringIndexOutOfBoundsException: String index out of range: 1

How I found out wich file it was:
deleting/reverting with help of svn (this was such a bad time)

My soloution:
-Opening the file in editor
-copy another prop-file paste it with the name of the broken file and
-type everything from the editor (copy didn't work for me) in the newly created file

Alley said...

Thanks!!!!!!!!!!

Mine seemed to barf on an external XML file.

Kawika said...

I had the same error - upon inspecting the log file I found that Flex choked because the directory 'bin-release/assets' did not exist. When I exported the release build to something other than 'bin-relase', it worked! Adobe really needs to get on top of these bugs...

Anonymous said...

Mine was an empty switch statement;

switch(asdf) {
/*
case 1: ...
case 2: ...
*/
}

Jay Wood said...

Mine was the same as Karfau's, except it was caused not by bad data in the properties file, but by using a very large (>180 Kb) file. I solved the problem by deleting a bunch of entries that were no longer needed.

Thanks Michael and Karfau -- you saved me a lot of time and a BIG headache!