For some reason FlexBuilder forces you to choose between creating Flex projects and AIR projects, and it doesn’t let you change a projects nature after it’s been created. This means that if you create a Flex project you will not be able to compile, debug or profile any AIR applications that you happen to build from the same code base. This has annoyed me to no end, but I have finally found the solution.
FlexBuilder stores it’s project preferences in a file called
.project in the project’s root directory. By looking at the difference between a project created as a Flex project and one created as an AIR project I found that the only real difference is in the <natures> tag. This is how it looks for a Flex project:
And this is how it looks for an AIR project:
Simply add that
com.adobe.flexbuilder.apollo.apollonature to a Flex project’s
.project file and restart FlexBuilder and create a new run, debug or profile configuration (Run → Run/Debug/Profile → Other…) in the AIR Application section. To be able to select a main MXML file it has to be set as a runnable application file. This is done in the project properties (right click on the project in the Flex Navigator and select properties) in the Flex Applications screen.
There’s just one little snag: as long as your project has the “apollo” nature you can’t create new Flex configurations, but that can be fixed by simply undoing the changes to the
.project file. The configurations you have created will remain and will work (although they don’t always appear in the Run menu, you may have to go into the run configurations dialog to find them, I haven’t really figured out why).