Archive for June, 2007

“Internal Build Error” or “Classes Must Not Be Nested” error

Lately I’ve been seeing these errors in Flex Builder and not been able to find any good reason why they’re happening. It seems like the errors alternate – sometimes it’s one, sometimes it’s several of the other – and there’s no easy way to figure out why they’re happening. Usually they’ll go away if you clean the project enough, but that’s a huge waste of time, so I’ve spent a few hours scouring my code and removing anything that might be causing the errors.

I’ve found that these errors can be caused by several different conditions. FlexBuilder doesn’t handle them well (indeed it seems to have exceptions in either it’s own environment or the compiler), so you get this generic error message instead of something useful.

Here’s a list of problems that I’ve found that can cause these errors. Hit up the comments if you have any others:

1. Forgetting the semi-colon at the end of your member variables.

Michael Imhoff documented this one first. For some reason, flex builder doesn’t flag this as an error while coding, and it doesn’t throw exceptions in the build if you manage to make it compile.

2. Having the same namespace listed twice with different extensions in your mxml

so this:

<Component
xmlns=”com.site.stuff.core.*”
xmlns:fanui=”com.site.stuff.core.*”
xmlns:mx=“http://www.adobe.com/2006/mxml”
creationComplete=”onCreationComplete()”>

should be this:
<stuff:Component
xmlns:stuff=”com.site.stuff.core.*”
xmlns:mx=“http://www.adobe.com/2006/mxml”
creationComplete=”onCreationComplete()”>

or with the default namespace declared, obviously – as long as there’s only one namespace linked to com.site.stuff.core.*.

3. Having the same import declared twice in an AS file or embedded AS in an mxml file

4. Commenting out certain lines of code and rendering trace statements unreachable.

I’ve never seen this, but it was documented as one way to get the error on Flex Coders.

According to Matt Chotin in response to the FlexCoders listing, this is a documented issue.  Hopefully it will be fixed in Flex 3.

Until then, good luck!

June 21, 2007 at 12:57 pm 58 comments


June 2007
S M T W T F S
« May   Jul »
 12
3456789
10111213141516
17181920212223
24252627282930

Recent Posts