Injections Failing in a 'release' build?

Tyler's Avatar


07 Aug, 2014 08:13 PM

Hello, me again....

we've got a strange issue here that I'm hoping someone can help me with... here are the scenarios...

1. We use -release to turn the debug mode off in the compiler
2. we use link reporting in child modules to optimize them

So this is what is happening:

debug on, link reporting off - works
debug on, link reporting on - works
debug off, link reporting off - works
debug off, link reporting on - fails.

When I say it fails, it hits the first mediated view of a loaded module and none of the injection mappings are being satisfied. Everything comes out null.

Thoughts? We can live without the link reporting in a worst-case scenario but ideally we'd like to have it.

  1. Support Staff 1 Posted by Ondina D.F. on 08 Aug, 2014 08:17 AM

    Ondina D.F.'s Avatar

    Hey Tyler,

    I think the culprit is the metadata stripping that I've mentioned in the last discussion. Other than that, the only Flex specific thing that could affect the loading of modules in a robotlegs based application is the aforementioned ApplicationDomain. (StyleManager can also be a problem, but it concerns the unloading of modules and gc) .

    When you run the release build, you actually run the optimized application. If you don't specify otherwise, the metadata gets stripped out in the optimized version. As a consequence, the Injector won't see any [Inject] metadata tags, so the injections fail. The same holds true for any libraries using metadata tags, or for Adobe's tags like Bindable etc, or for any custom metadata tags that you added to your code [GrilledCheeseSandwich].

    Flex is pretty annoying sometimes when it comes to compiling modules.

    You might want to do a research on compiler option needed for optimization, especially when using link-report to set load-externs.

    Adobe says: " You must specify the keep-as3-metadata option and pass it the required metadata. At a minimum, you should specify the Bindable, Managed, ChangeEvent, NonCommittingChangeEvent, and Transient metadata names. You can also specify custom metadata that you want to remain in the optimized SWF file."

    See Using standard and cross-domain RSLs for more details:

    Also, see the links mentioned in this discussion:

    Hope that helps.

  2. 2 Posted by Tyler on 08 Aug, 2014 01:04 PM

    Tyler's Avatar


    Yep, that did it... thank you very much!

  3. Support Staff 3 Posted by Ondina D.F. on 09 Aug, 2014 08:19 AM

    Ondina D.F.'s Avatar

    No problem! Glad it worked out.

  4. Ondina D.F. closed this discussion on 09 Aug, 2014 08:19 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac