Byte limits
There are 2 kinds of byte limits depending on operating system and Flex version.
32K Byte limit
Question: You receive a log message after deploying my application similar to this one:
Error in compiling Flex application:
Error: Branch between 8479 and 41869 around line 0 exceeds 32K span.
If possible, please refactor this component.
Failed to compile AAD8T3.mxml
Solution 1
This is the well known 32K limitation from Adobe Flex 1.x. The compiled applications are not allowed to be larger than 32K. That usually happens with larger models.
In order to solve this issue, you need to redesign your application and use nested iViews (basically splitting the model into multiple smaller models)
Solution 2
Multiple users have reported that one of the following activities also overcomes this problem:
- Under Tools -> Options -> Compiler select and then unselect(!) (or simply unselect) the checkbox Add Flash debugging console, this error disappears.
- Add one or multiple layers to your model and delete them
- move objects on the storyboard
Analysis: it looks like Visual Composer sometimes piles up more model tags than necessary and periodically deletes them after an activity like described above. When you are close to the 32K limit, being slightly over or under seems to depend on your activity.
Solution 3
- Add an empty layer to the Main iView in the VC Model and make it invisible(!). Removing the layer again as described in the note doesn't help also I had problems deploying when the Layer was visible.
- Add a layer to every nested iView in the Model too.
- Please be sure to un-tick the glasses column for the layer.
More solutions
- Optimize each model to reduce the number of elements that it contains:
- Reduce the number of signals by merging signals of the same name.
- When your application updates forms with read-only fields, use expression boxes and a data store instead of signals.
- Minimize the use of animations in your models, including form sliding and chart animation effects
- Use a data store to store variables, instead of invisible forms. To display messages, use a simple text rather than a static dynamic expression.
- For on-the-spot, temporary workarounds, you can try dragging an empty layer onto the Design board. This sometimes solves the problem adhoc, but is not recommended as a best practice.
Final Solution
The Fix for this issue will be delivered within an enhancement package in February 2008. It comes with Flex 2.0 server which solves the 32k bug.
64K Byte limit
Question: While deploying the VC model , i m getting this error:
Error in compiling Flex application: Error: A function in the code exceeds the 64K byte limit (actual size = '65557'). Since the problem occurs in the compiler-generated deferred instantiation code, please refactor/componentize portions of this document.
(/usr/sap/NW2/JC00/j2ee/cluster/server0/GUIMachine_Business_Packages/Contribution_Margin_36461/FLEX_COMPILATION_FOLEDR/AAD15VY.mxml:19)
Failed to compile AAD15VY.mxml
Solution
The 64k problem refers to a single function or statement that is too long for the Flex compiler, be a bug or not. Unlike the 32k error, the message is a bit clearer. (...A function in the code exceeds the 64K byte limit... ).
Remove the longer statements from the model and the message will vanished.
Probably the part of the message:
...AAD15VY.mxml:19
gives a better information where the problem can be found in the XML-file.