Wednesday, May 12, 2010

Clear improperly cached compile errors in FlexBuilder

If FlexBuilder is giving you a compile error that shouldn't be happening, and nothing you do seems to make it go away, it's possible FB is failing to clear its cache. Try going to:

workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\<project>\

and deleting the .markers file. Restart FB and do a clean build.

Explanation after the break.



I ran into a fairly annoying issue with FlexBuilder yesterday. One of the files had had a compile error in it, but even though I had undone the changes to the file (removing the offending line) FB still claimed there was a compile error.

I refreshed the project directory and did a clean, but the compile error still wouldn't go away. I tried making other changes to that file (hoping it would force a recompile), but still the error persisted. Even tried closing the project, quitting FB, and restarting, but it still wouldn't go away.

Eventually, with the help of Process Monitor, I tracked down where the error was being cached.

FlexBuilder (probably eclipse itself actually) caches project data under the .metadata directory in the workspace. This is probably obvious to people familiar with eclipse, but I'm generally a NetBeans (or just Vim) guy myself, so I didn't know about it. Specifically, the files are under:

workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\<project>

In this directory there was a .markers file, which appears to be a cached copy of all the compile errors/warnings/etc. It appears that for some reason this file wasn't being cleaned up. After deleting the file the compile error went away, and I was able to continue normally.

There are other files in there as well, so I'm guessing if FB behaves like it's caching things strangely it might help to delete the files in that directory. However, it's possible that some of those files are actually important (though worst-case is you have to re-import your source).

No comments:

Post a Comment

Post a Comment