Flex Library Project won’t build? Check for build errors.

I ran into a particularly sticky problem today with Flex Library Projects in Flash Builder. I wrote up my issue as a Stack Overflow question, and subsequently managed to figure it out.

In short, as soon as I cut/pasted certain classes into my Flex Library Project, it would no longer rebuild the .swc file in the /bin folder. No matter what I did after pasting in that file, I couldn’t get the .swc to update.

The first symptom was that other projects referencing this Library Project could not find the classes in the Library Project even after I had pasted them into the Library Project. More sluething led to the frozen .swc in the Library Project.

After a while, I noticed that the class I pasted in had dependencies on other, absent classes. This caused build errors (apparent in the Problems pane, but unnoticed by me until then), and those errors caused Flash Builder to stop updating the .swc file.

Simple enough once I noticed the errors — of course Flash Builder cannot recompile the .swc when there are build errors. But there was no obvious indication of these errors, nor that building was failing. Once I cleared up the build errors, the .swc automagically reappeared.

The original source of the build errors turned out to be one unchecked box: when I initially created the Library Project, I neglected to check ‘Include Adobe AIR Libraries’. My library classes referenced some (absent) AIR classes, I got build errors, the .swc would not compile, I could not reference any of the library classes from other projects.

Leave a Reply

Additional comments powered by BackType