Flash Error 5005 Unknown Error Optimizing Byte Code -- UPDATED
Posted by Tres Mon, 09 Feb 2009 20:56:00 GMT
When working on a larger project with Actionscript 3 I started seeing this error while building.
The appearance of the error was related to a new class I was writing & when debugging, the error consistently occurred when certain lines in the new class were not commented & wouldn’t happen when they were.
This is a nightmare scenario for me… ye olde ‘unknown error.’ I began to have the sinking feeling that I had stumbled upon some deep bug that would halt everything & I’d spend the next hours trying to find some workaround… and then I could only hope that it wouldn’t happen again.
A simple restart of Flash got things running right again.
I’m glad it was so simple, but I guess I’m much less forgiving about flakey desktop apps than I once was. Hitting ‘Save’ every-so-often is just not something I’m willing to do, and I know people who work with Adobe desktop apps often just accept that as a fact of life.
I’ve been using the standard file layout for Flex for a while now, but I’ve been reticent to move to Flex because I’ve got other things to worry about & Flash works most of the time. Things like this make Flex much more appealing.
I just need to write some build.xml files now.
Update:
Turns out that the restart didn’t solve the problem. It helped, but I was still seeing the error cropping up.
To fix the problem you’ve got to set the JAVATOOLOPTIONS environment variable to ‘-Xmx1024M’
To set this on OS X, just point your property list editor to ~/.MacOSX/environment.plist. If you’re not showing hidden files in the Finder, you can do this via the shell with the following:
open ~/.MacOSX/environment.plist
then create a new item. Set the key to
JAVA_TOOL_OPTIONS
and set the value to
-Xmx1024
To make this active, you’ll need to log out and log back in.