Avoiding “Error creating air file: 303″ when compiling a Flex project with an icon
Adding icons to a Flex WindowedApplication project should really be super simple, but because the error messages you get are when something is off are not specific about what is wrong, it took me about forty minutes of googling to find out what was up with these “303: ERROR” messages. So, just in case, you, readers of Notes of Chaos, ever want to specify icons for your Flex desktop application, I’m going to save you some time and tell you what to look out for.
1. You specify the icon files in the yourappname-app.xml file under the <icon> tag. There’s child nodes under that tag: <image16×16> through <image128×128>. Whether or not you think an icon size is going to show, you need to specify one valid image for each of those image tags, or you’ll get the 303 error.
2. The content of those image tags must be a path to an image file that is somewhere under src in the project hierarchy. Flex can’t find the image files outside of src. So, if your 16×16 icon is in src/icons, you’d specify: <image16×16>icons/myicon16.png</image16×16>
3. I read some posts by a guy with an Adobe logo as his userpic that the images have to be in PNG format and that they have to be the sizes specified by the tag.
4. In Project | Properties | Flex Compiler, the “copy non-embedded files to output folder” option must be checked. This will copy the icons to the output folder, and I guess Flex looks for them there, because without it you get the 303 errors.
5. When you build the debug build, no attempt is made to incorporate the icons, as it’ll be running from the debug launcher anyway. When you build the release build is when it actually bothers with them.
6. In the Export Release Build wizard, you can usually just hit Finish on the second panel, but not if you have icons for your app. There’s another panel, which I didn’t know about before. Hit Next on the second panel, and you’ll get to the mysterious third panel, “AIR File Contents.” It lets you select files you want included in the built package. By default, it’s going to include a bunch of unneeded crap, so you probably want to hit Uncheck All and then check the folder containing your icons.
Hopefully, once you do all that figurative i-dotting and t-crossing, Flex should stop giving you a message box full of cryptic 303 error messages and build you an AIR package that installs an app with fancy, or at least non-generic, application icons.
Tags: actionscript, flex

Add New Comment
Viewing 7 Comments
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Do you already have an account? Log in and claim this comment.
Add New Comment