Home > Flex(Amazing Errors) > Compilation Error: An internal build error has occurred. Right-click for more information.

Compilation Error: An internal build error has occurred. Right-click for more information.

This is another chapter to the amazing errors, which does not leave behind any signals how to solve it, and more interestingly what is the exact reason for it.

When we have a pretty large code base where many developers check in and check out the code regularly, it is very hard to find the exact cause of the error which comes while compiling the code. Same thing happened with me and to find the exact cause and the solution for it took a lot of time and interestingly and amazed feeling why it is happening so,

For Demo let’s compile the following code,

Case 1: Error :An internal build error has occurred. Right-click for more information

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
creationComplete="init()">

<mx:Script>
<![CDATA[
private function init():void{
var type:String;
switch(type) {
/* case "test":
break; */
}
}

]]>

</mx:Script>

<mx:Label text="Blank Switch"/>
</mx:Application>

While Compiling we get the Compilation error as “An internal build error has occurred. Right-click for more information.” No line number in error and we start scratching our head. But solution is simple just remove the switch block and application will get compiled again and we can move on with coding.

Case 2: Error : Classes must not be nested.

Replace the init() method and compile the code we get the error Classes must not be nested. same problem here but at least this time we will get the error at function call so it is bit easier to track

private function init():void {

var type:String;

switch(type)  {

case “hi”:

//var i:int = i+1;

break;

}

}

]]>

solution is simple just remove the switch block and application will get compiled again and we can move on with coding.

Same Problem is been discussed here as common problem but some times it becomes hard to find it so.

http://learn.adobe.com/wiki/display/Flex/Flex+Builder+3+Compiler+Errors

Case 3: 1047: Parameter initializer unknown or is not a compile-time constant.

Possible Solutions:

Checking the constant at function argument,Constructor is one of the big cause of such error,

like

package

{

public class Test {

//Constants is Class

//public class Constant{    public static const  LOGINNAME:String=”test”       }

public function Test(s:Sting=Constants.LOGINNAME){          

}//Function test Ends Here

}//Class Ends Here

}

Solution: Here if  we replace s:Sting=Constants.LOGINNAME by s:Sting=”test” Error is resolved

1047: Parameter initializer unknown or is not a compile-time constant. Error will be solved. Note that for error to display we must instatiate the Test class

Some other reasons :

Missing semicolon in Anycode where you have defined constants and Forgot to enter the Semicolon.

Especially if you use ArrayCollection in Constant you mest give a semicolon or else be ready for Unexpeted error.

See if Server is in restart mode then some times project doesnot get cleaned up properly and deployed properly so check Server status as “Started” and clean project it will do for you.

Thanks and regards

Shashank Kulkarni

Feel free to comment on the post :)

  1. August 19, 2009 at 3:53 pm | #1

    charming post. upright one decimal where I bicker with it. I am emailing you in detail.

  2. September 22, 2009 at 5:56 am | #2

    I don’t know If I said it already but …Cool site, love the info. I do a lot of research online on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say I’m glad I found your blog. Thanks, :)

    A definite great read..

    -Bill-Bartmann

  1. No trackbacks yet.