Sunday, February 3, 2008

Errors 5003 & 5005

I have to add some proof of concept files to this post. Will try to use skyDrive from MS.

Error Code 5005
Error Code 5003

These numbers mean it time to refactor.

"5003: Unknown error generating bye code."

"5005: Unknown error optimizing byte code"

They both stem from the same problem. Flash not knowing how to handle
an "Out Of Memory" error exception from Java from the (asc_authoring.jar) file. You can see this if you try
to build in Flex.

This happens when there is just too much code for it to handle with the default memory space of 128MB.

If you ever compile a SWF and just get a blank screen it could be because the SWF does not contain any of your code.

To verify this look at your generated size report file from the Flash IDE. The section which says "actionscript code bytes" will be about 16 bytes. The SWF does not know where to jump to execute your code because it has not been inserted into the SWF

This could be fixed by specifying -Xms and -Xmx command line arguments when compiling the SWF with the asc_authoring.jar file.

Unfortunately, you can't do this in the Flash IDE. I have modified the asc_authoring.jar file to see if I can actually save the parameters used in the build, so that we can use the command line with the appropriate memory setting but so far I have been unsuccessful.

Adobe support was no help with this matter. They are pretty clueless of this from my experience with them.

Temporary ways of dealing with this:
  1. Delete ASO files
  2. Comment out all trace statements.
  3. Uncheck “Reduce File Size and increase performance” in AS3 settings
  4. Create a singleton class with static empty classes that get filled in at runtime (Bridge Pattern).

Other sites mentioning these errors:
  1. www.kirupa.com
  2. www.negush.net
  3. www.ultrashock.com
Settled on solution:
Moving over to Flex and using Ant to build will resolve this error if you use the environment variable ANT_OPTS with the correct memory requirements for the build.

11 comments:

Anonymous said...

In Flash CS4 you can get this error from a Vector typo as well.

new Vector(10, false).<SomeClass&rt;; will generate that error, while using the proper syntax works.

new Vector.<SomeClass&rt;(10, false); works.

Took me a while to figure that out.

Anonymous said...

Uhm, ya', so make that > instead (:

Unknown said...

open cs4 prefs on mac, change line 128
log out/restart

the mem allocation via macos plist was not working at all

Unknown said...

This will solve your problem. Increasing the maximum amount of memory the java compiler can use.

This comment should apply to CS4 and CS5.

http://forums.adobe.com/thread/631692?decorator=print&displayFullThread=true

Anonymous said...

Just delete your unwanted moviclips from fla. + Try to load heavy moviclips from outside by making another swf. This will definetly solve this problem

Brad Fallon said...

iphone apps in flash CS 5 for non jail break phone,and no developer license ?

fico score said...

my mp3 playeris showing flash error please backup what does this mean and how do i do that please this is new?

2nd birthday party themes said...

How do I fix the "youtube flash/javasript error' which my computer started getting a week ago?

2nd birthday party ideas said...

With regard to evolution being caused by replication errors, insertion errors are more frequent than deletion?

eb 5 visa program said...

How to fix oblivion installation error (-5003 0x5) but plz no intense computer talk?

Miami Real Estate said...

when trying to play a worldwinner.com game i get three errors error downloading file,error retrieving game con?