If you're using Eclipse with the Flex Builder plug-in you have no doubt run across this frustrating error. The error taunts you to "Right click for more information" but when you right click the only thing that happens is your web browser opens to a page that tells you absolutely nothing about the error. So what to do with an indescript error that comes out of nowhere?
I've compiled a list over the past few months of the reasons I have seen this error and what I have done to get rid of it in the hopes of helping other frustrated developers who have come across this.
1. The most common cause I've found is an empty switch statement. You make a switch, then decide to comment out a few lines in it without realizing that you've commented out every line of code inside the brackets. Comment out the whole thing or remove it altogether and you won't see this error!
2. A trickier reason that I ran across happened when I stopped a debug session but Eclipse didn't fully kill it. I noticed this when I tried to clean and rebuild but the clean refused to run. My swf couldn't be removed and recompiled for the clean because it was still running. Kill adl.exe, rebuild and this error will disappear!
3. When renaming an existing project, the .project and .actionscript files occasionally aren't updated correctly. Linkage problems are a hassle to unravel, so avoid renaming projects unnecessarily, or if need be, create a new project from scratch with the new name and move files over into the new setup. (Be careful not to copy over the SVN info if you're moving over files that are committed to SVN!!)
4. I have also come across a few other blogs that mention missing semicolons as the culprit, usually referring to the definition of a variable one line ahead of a Bindable tag. I have yet to see this cause a problem even when I tried to cause the error, though it's worth checking for missing semicolons if all else fails.
If none of these reasons are what is causing your error go to the root directory of your workspace and check the .metadata directory for a log file. The errors included in this file are usually as convoluted and indescript as the internal build error itself ("!MESSAGE Uncaught exception in compiler !STACK 0 java.lang.NullPointerException at ..."), but occasionally there is an extra bit of info that may help. This can also be reached by going to Help -> About Eclipse SDK -> Configuration Details -> View Error Log.
21 Comments
Hi i’m trying to export a flex/J2EE application as a release build but it generates me an error “An error has occurred. See error log for more details.java.lang.NullPointerException”.
Please can you help me.
shinigami – These are all the reasons for this error I have found, but this is by no means a complete list. Unfortunately all of these cause a compile time build error, I have not run into this during exporting a release so I’m afraid I don’t have much advice for you.
Ok can you just help me please deploy my application under another Tomcat server. I copied all the folders into the Web-app folder. The application runs but doesn’t fully function(it doesn’t recognize my servlets neither the database”.
I’m in deep shit right now please help. and thnks in advance.
I had this problem yesterday. None of the above applied to my situtation though. It was caused by a SWC file I exported from Flash. The error message is really useless as it doesn’t give you any hint where to look for the problem.
So when I exported the SWC file everetything was fine again… but of course that was the last thing to try.
Still leting of steam
Thanks for the tip Timo, I’m sure it will help at least a few others who are pulling their hair out trying to find the source of this error.
Restarting Flex builder also helps!!!!
One more cause I found is if you call non-static function as static
class MyClass
{
public function f1()
{
}
public function f2()
{
MyClass::f1();
}
}
Maybe this will help somebody.
While I was debugging my code on eclipse this error appeared all of a sudden. Fortunately I had a backup of eclipse installation.
I’m using windows XP and my eclipse is installed in C:\Program Files\Eclipse.
This is how I fixed this problem.
1- I closed my eclipse application.
2- I renamed the directory C:\Program Files\Eclipse\plugins to C:\Program Files\Eclipse\pluginsxxx (for security incase you might need to revert back).
3- I created a new plugins directory in C:\Program Files\Eclipse\
4- I copied the contents of plugins folder from my backup in path_to_back_up\eclipse\plugins to C:\Program Files\Eclipse\plugins
5- I restarted my eclipse application.
6- I debugged happily ever after!
Another reason for this error is a locked SWF file. After getting this error, I noticed that this file was locked by the Flash player. I unlocked the file with the program Unlocker, and it started compiling again.
There’s quite a few explanations for this annoyingly abstract error, I guess.
Be sure to check the Flex error log files. For me, I had my project saved to a shared network folder over Samba. When I rebooted my machine, the newtwork drive map was disconnected, so Flex couldn’t locate the SWF file to save to. Once I reconnected my network drive, it fixed the issue.
I also get this error, in my case it was simply that my server wasn’t turned on! my project is defined as “PHP” and that is why flash builder/eclipse was trying to copy files to my server. Unfortunately rather than just saying it couldn’t find the server it gives this rather cryptic error message!
I hope this tip helps others…
Mark.
I had this error too, due to a class which extends itself (I did a mistake while renaming a file
)
++
Using embeded SWC with typing-error in IDs can cause the same error.
This ia actually happening to me in FlexBuilder3. i have not been able to create a build release for a week now. HELP ME!!!!
Another major reason you might see ‘An internal build error has occurred’ is if your build path writes the file to a network drive. Specifically, I develop on one machine, and have the build write out to another through a mapped network drive, to a folder in my rails app.
I find that Eclipse doesn’t know about network drives unless it specifically is shown them by open the project properties, selecting the build path config, then choosing browse and simply browsing to the network drives. You can hit cancel in the folder browse dialog just as long as you actually navigate to that drive first. Eclipse then ‘knows’ about that drive and can compile there. This also affects AIR if you are say showing a File/Folder Tree. The mapped network drives (at least on Windows) won’t show up until you do a similar trick, when the AIR app is run from the debugger.
Another cause I found is when I set the value of an inherited protected Number variable. e.g.
public class ParentCls {
protected var myNum: Number = 10;
}
public class ChildCls extends ParentCls {
public function init(): void {
myNum = 20; // Removing this line stopped it breaking.
}
}
Thanks! The log file helped me debugging the error.
The output folder was on network which I didn’t logged on to before compiling and giving me the error.
In my case it was a type selector in a CSS file, that was not used.
WTF! Does Flex Builder gives an error about it? Why does it care there is a type selector that is not used?
Flex would never be my choice, justs because of there bad SDK c.q. Builder. But im kinda forced to work with it
My error might be the dumbest of all. I wanted some debugging output to be cleaned up. So I had something like:
var debug = true;
…
if(debug){
…bunch of traces..
}
I wanted the ‘bunch of traces’ to go away, but for debug to stay on, so I lazily put:
if(false){
…bunch of traces…
}
Yep, ‘if(false)’ causes this error. Got rid of it, all good now.