Runtime error when compiling flex application with ANT - apache-flex

I'm using a licensed version of Flex Builder Pro to develop an application.
I compiled the swc and generated swf successfully using ANT tasks.
It contains an Advanced Data Grid also. When this application is accessed, I get a runtime error and it fails to load.
TypeError: Error #1007: Instantiation attempted on a non-constructor.
at mx.controls::AdvancedDataGridBaseEx/getSeparator()
at mx.controls::AdvancedDataGridBaseEx/createHeaderSeparators()
at mx.controls::AdvancedDataGrid/createHeaderSeparators()
at mx.controls::AdvancedDataGridBaseEx/drawSeparators()
at mx.controls::AdvancedDataGridBaseEx/updateDisplayList()
at mx.controls::AdvancedDataGrid/updateDisplayList()
at mx.controls.listClasses::AdvancedListBase/validateDisplayList()
at mx.managers::LayoutManager/validateDisplayList()
at mx.managers::LayoutManager/doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/callLaterDispatcher2()
at mx.core::UIComponent/callLaterDispatcher()
I'm adding datavisualization.swc and datavisualization_rb.swc in the build paths.
How can I successfully compile the application without any runtime errors?
Please help.

Include the swcs in the library path as shown here.

Maybe this helps: http://kb2.adobe.com/cps/403/kb403121.html

By coincidence I had the same error a couple of days ago. The source of this problem was a library against I built, which was linked statically against an older version of the datavisualization libraries. Normally libraries should only be compiled against other libraries using the external-library-path compiler option, but this library was compiled incorrectly.
So that library contained older parts of datavisualization that were referenced by code in the library, while my code referenced newer parts from the datavisualization library itself. The result was a mix of older and newer datavisualization classes at runtime.
So check the SWCs that you include in your library path. You can extract these with a ZIP tool. You will then find a catalog.xml file in there. Search for mx/controls/AdvancedDataGrid in this file. In case you can see it included in the catalog, you've found the bogus library.

Related

How to Blazor compile multi file c code to wasm

THe blazor docs show a trivial example https://learn.microsoft.com/en-us/aspnet/core/blazor/webassembly-native-dependencies?view=aspnetcore-6.0 where the c code is in one file. I made my own version of that and got it to work, but now I want to compile something that has multiple files, has non trivial source tree structure, makefile etc.
You have to use Emscripten (version 2.0.23) to compile all dependencies to wasm, and then link them, which is the tool that NET also uses to compile your C source.
Emscripten supports make & cmake so you can change the make files to use emcc instead and rebuild the project.
Im also asking about similar issue but more library specific, perhaps the sources there can provide you with some help.

Does Qt creator by default statically or dynamically link it's libraries?

I'm developing a closed source application and to do so in accordance with the LGPL I have to dynamically link Qt's libraries to my application. Does Qt do this by default or do I have to take steps to do so? If that's the case how would I go about doing it?
Qt uses dynamic linking by default.
You'll notice this immediately during deployment to a non-developer machine, because your code will not run without the Qt libraries.
If your concern is the LGPL, just be careful when compiling Qt itself. Most LGPL violations with Qt are not because of static linking (since dynamic is the default), but for compiling Qt with non-default parameters.
LGPL is not just that the library must be provided along your binaries, but also that you specify how your users can build themselves the LGPL part. If you compile Qt yourself and do not use the pre-compiled binaries from the website, you must document that part of your build configuration in your release!
As soon as you get something running on your program, start preparing a release version for a non-developer environment without Qt installed. Your program should fail as soon as you delete the DLLs that you must copy along your program (or whatever format your OS uses).
It does it by default, statically linking seems to be quite involved judging by the many questions on the site regarding it.

Compiling with Flex4 SDK

I'm trying to compile an existing Flex3 project with the Flex4 SDK. I'm getting this error:
Warning: This compilation unit did not have a factoryClass specified in Frame metadata to load the configured runtime shared libraries. To compile without runtime shared libraries either set the -static-link-runtime-shared-libraries option to true or remove the -runtime-shared-libraries option.
The resulting file is roughly the same as my old Flex3 compiled .swf file. Playing the resulting .swf file in the Flash Player also gives the following errors:
An Actionscript error ocurred: VerifyError: Error #1014: Class spark.core::SpriteVisualElement could not be found
If I set the compiler attribute static-link-runtime-shared-libraries to true, then the error disappears and all is well. However, the size of the resulting .SWF is a couple of 100K's bigger. And that's not what I want.
I don't fully understand the concept of runtime shared libraries, but it seems that with the option to statically link them set to true, the libraries are included in the .swf. However, I like to exclude them from the .swf and only load the needed library at runtime, as my project seemed to do with Flex3 (I didn't know that by the way).
If I understand correctly, playerglobal.swc should hold all the necessary code for the external libraries that my .swf has to load. Do Flex4 compiled files need more libraries? Should I do something with the factoryClass in the Frame metadata tag?
I think my question boils down to this: How do I compile a Flex4 .swf that is the same size as my previous Flex3 compiled .swf?
You have to add [Frame(factoryClass="path.to.your.preloader")] to the main class (the one you set in the compiler options).
Flex3 did not use rsls by default but you could enable them. Flex4 rsls are enabled by default, see: http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7add.html
The concept of runtime shared libraries is: splitting of a part of your application that is (re)used by other apps as well, thereby only requiring the user to download it once. This won't save anything on the first download but will save on later downloads. You could possibly make your own rsl, but it's mostly the ones provided by adobe that are meant to make the difference: Since 'everybody' will use them there will be a bit chance the library you need is already present on the user's system, thereby speeding up the download-time of your app.
playerglobal.swc never contained any flex framework classes, most of them are in flex.swc and framework.swc (a standard flex 3 project also includes rpc.swc and utilities.swc - I didn't check but these probably contain some flex parts as well)
Looks like you might have project migration problems. You might want to read up on the process on:
http://www.adobe.com/devnet/flex/articles/flexbuilder3_to_flashbuilder4.html
It's a really good article with overview of different possibilities for migration, depending on the amount of Flex4 stuff you want to use.

Flex/Actionscript: Unable to add archive file

I have an Flex 4 application that I am developing in Flash Builder 4. I'm trying to use a library developed by a coworker, which was delivered as an SWC.
I added the library to the Library Path in the project properties. Component set: MX + Spark, Framework linkage: Merged into code.
When I attempt to instantiate a component from this library, I get the following error:
unable to add archive file: [library].swc$locale\en_US\..\..\resources\images\AcceptButton.png (The system cannot find the path specified)
When I unzip [library].swc, the image does exist in .\resources\images\AcceptButton.png as I would expect.
Any suggestions to go about resolving this would be much appreciated.
Your best bet is probably to get the uncompressed source code and see if you're having the same problem. It's difficult to guess at what's going wrong inside a swc file. It should function the same way as the SWC.

ActionScript error #1053 - Illegal override of allowInsecureDomain in _MonkeyContacts_mx_managers_SystemManager (FlexMonkey code generation example)

I'm following along the MonkeyContactsCodeGenExample guide and when I run the ant target for test-with-launcher, I get a popup saying:
VerifyError: Error #1053: Illegal override of allowInsecureDomain in _MonkeyContacts_mx_managers_SystemManager.
This is followed by:
ReferenceError: Error #1065: Variable _MonkeyContacts_mx_managers_SystemManager is not defined.
These popups are from the debug flash player - the normal flash player would silently supress these errors.
It seems that these sorts of errors occur when different files or swc components are compiled under different SDKs. If so, what parts would I need to recompile in this situation?
I checked out the flex project sources and have rebuilt them under SDK 3.4, and I also got the project sources for fluint and have recompiled those already. The newly compiled fluint.swc was then copied to the lib directories of the MonkeyFluintAirTestRunner and MonkeyTestLauncher projects and then everything was re-built, but I still get this error with the MonkeyContacts example.
I just ran into this myself today. I just needed to recompile the MonkeyAgent.SWF.
As per a note on the FlexMonkey site, I used the Easy2BuildMonkeyAgent project to do this. I didn't look into why they recommended this, but it worked for me.
Beware, I ran into a problem compiling this because I use the standard 3.4 SDK that was installed separate from Flex Builder. The the standard 3.4 SDK, the automation.swc file (and others) aren't there, so I had to grab copies from the FlexBuilder 3.0 SDK folder into the 3.4.
Don't forget to copy the corresponding files from locale/en_US: automation_agent_rb.swc, automation_rb.swc

Resources