Why don't FastInject tags work in my Flex/Air Parsley project when build in release mode? - actionscript-3

I've got a project that I am working on that works fine when debugging from IntelliJ but when I do a release build (still in IntelliJ) and install the .air fil to my computer none of the FastInject tags seem to work.
I thought that this might be due to the include-as3-metadata issue but that does not seem to be the case. I have included all the metadata tags that I think I have used.
I have spent some time investigating this and have not made much progress other than getting frustrated!
I created a view that displays the logs created by spicefactory - but this seemed to fix the issue!
I tested to see if I could inject and of classes that are expected to be FastInjected, this also fixed the issue.
It seems that if I add any logging related code to the application the FastInject tags start working.
In fact, I have created a release air file here. If I install this on a computer with Flash debugging turned on the application doesn't work. If I follow the steps here to debug an installed Air application - it starts to work!
If anyone else can confirm this behavior I would appreciate it.

It turns out that this was simply a race condition causing an error in context creation that was not displayed in a non-debug player.
This exception never happened while I was developing the application and any changes to the application to add logging changed the initialisation order of the context and caused the issue.

Related

libgdx unable to find com/esotericsoftware/tablelayout.gwt.xml on your classpath

I just setup my libgdx game with the gdx-setup-ui.jar today and I have everything setup in eclipse. I thought I would run each application (i.e. desktop, android, and html) to make sure everything is working ok. Unfortunately, I ran into problems with my html application. I am getting this error with a tablelayout.gwt.xml:
I have no idea how to solve this problem. Is there a fix for this problem and if anybody knows it could they share? Thanks!
EDIT
So even though i fixed the problem by restarting my project, my problem has come back. This time, however, I am too far along in development to just restart my project, or re-setup my project.
I deleted my old project and created it again using the gdx-setup-ui.jar application and made sure that all the necessary libraries were included.

AIR - Supress Error messages in debug app?

In a packaged AIR app, I need to add a file called debug to C:\Program Files (x86)\The App\META-INF\AIR\debug for the software to function 'correctly' - I think it is a database error but I can not find anyway to solve it at the moment.
Is it possible to add this debug flag, but to suppress/hide any modal error boxes that may appear from another possible yet unknown bug?
Not sure I fully understand your problem. If what you need is some specific behavior only happening when you run the app in debug mode, then take a look to conditional compilation for example here.
But again, unsure I fully understand your problem!

Flash Builder bug?

Irritatingly, Flash Builder refuses to implement any changes I make to the program when I run it. I can't find any documentation of this anywhere online after a brief googling, just wondering if anyone has come across this problem before and/or found a solution? I don't want to have to export a release build every time I want to check if any changes have been implemented successfully (I'm just assuming that'd work)
It happened to me once before but I overcame this problem simply by starting a new project as there wasn't much of any significance, and couldn't easily fix it.
It's pretty much as simple as it sounds tbh, having returned to my computer a couple of hours after leaving it I find any changes to any part of the code have no impact on what is displayed when I go to run...
Any insight would be much appreciated
Thanks
Josh
It could be the cache of your browser. Clear your cache and see if that works..
It could also be because you have classes that are compiled in external swf's. If you compile in Flash Builder, you're not persee recompiling those classes. Instead, compile the external swf which has links to those classes.
You'd think if this were a bug in Flash Builder, people would be complaining about it a bit more often, check that your browser is updating properly, most likely you've got the SWF stuck in your browser cache.
Check the "clear application data on each launch" in Run/Debug Configuration window.
This will clear and uninstall existing app installed in your test device, so every new launch will have clean build.
Tips : Make sure to cmd/ctr + B first, In every run/build.

Flash Builder 4 changes not compiled

Im using Flash Builder 4 on the Mac and I have a worrisome problem: The compiler is sometimes not detecting my code changes.
For example I might write some code, compile and run, then add some logging statements, but they will not print. After a clean compile everything runs as expected.
I cannot see a pattern to the exclusion of changes. I'm wondering if anyone else is having the same problem?
Details:
Flash Bulider 4
Pure AS3 project targetting Flex3.5 SDK
Max OS X Snow Leopard
My code does not use semicolons to terminate statements
The problem is with the SDK settings selected for the Compiler.
Try going to 'Project' > 'Properties' > 'ActionScript Compiler'.
Now, in the 'Flex SDK section', try changing the SDK. Click on 'Apply'.
This will force FB to rebuild all settings for the project.
You can try again. FB should now have started compiling with latest code changes again.
Please Note: This is not a permanent fix though!
In case the problem re-occurs, you'll need to again perform the steps mentioned above to get FB back on track.
As bad as it sounds, I am now used to this behavior, I use FB4 on a Mac , but remember having the same issue with Flex.
Practically, I keep clearing the browser cache and cleaning the project. I have thought about adding some random number after the swf url so that it never gets cached but haven't implemented it yet. Force of habit I guess, clearing the cache & cleaning the project has become such a routine!

AS3 Embedding assets - "Warning: Failed to parse corrupt data"

I've got an AS3 project where I'm trying to compile in several images, a soundtrack, and a video via [Embed] metadata. It's a product requirement that these be embedded, so network transfer is not an option.
I'm getting some really strange behavior - a sort of intermittent corruption of the compiled-in data. Sometimes after the project compiles, I run the swf and it closes immediately and writes "Warning: Failed to parse corrupt data" to the flash log. If I delete the binary and clean the project, sometimes it'll run fine after building it again. Sometimes it doesn't.
This is probably the strangest part about this problem, but sometimes when I see that error, I can physically move the video [Embed] lines to the end of the file, then clean the project, and it will build and run no problem. Sometimes I move them back to the beginning of the file and it builds and runs fine.
It kinda seems like it might be a bug in the compiler. Has anyone else experienced something similar? I'm targeting Flash 10.1 and using sprout (http://projectsprouts.org) to build my project. This is the mxmlc line that's being used to compile (mxmlc Version 4.1.0 build 16076):
mxmlc -as3 -static-link-runtime-shared-libraries=true -debug -default-background-color=#ffffff -default-size 712 400 -output=bin/ProjectName.swf -source-path+=.preprocessed/src -source-path+=.preprocessed/assets .preprocessed/src/ProjectName.as
I've tried both removing the -debug compiler option and adding the -optimize option, but no luck.
Everything is being ran through the GNU C preprocessor for some other tasks, so maybe I'll try removing the preprocessor stuff and hardcoding those variables...I'll try that and post the results tomorrow.
Any insight at all would be much appreciated. Thanks!
EDIT:
This project is going to be compiled dynamically with different assets being embedded into the same codebase, so switching to something like Flash Builder for compilation really isn't an option...it must be done via command-line mxmlc.
UPDATE:
Turns out the corrupted data message was due to images created with Photoshop's "Save for web" feature. If I save them outright as PNG images I don't get the message. However, the intermittent nature of the movie compiling properly still seems to be an issue. Now sometimes when the project is compiled it won't throw any compiler errors, but I get a blank flash player window. Right clicking in flash player shows a context menu with a message that says "Movie not loaded..." This doesn't appear to have anything to do with things being ran through CPP first.
[Screenshot]
This is apparently a bug in mxmlc under Mac OS X. After posting this, I observed some other really strange behavior, so I switched the whole codebase to Windows 7. Everything works as expected there (still using Project Sprouts as a build tool).
Flash builder is fine with it.
Can you separate your issue for video or music only, or issue is true for both includes?