Class mx.core::DesignLayer could not be found - apache-flex

I am trying to run my Flex project, however on runtime I get the error:
VerifyError: Error #1014: Class mx.core::DesignLayer could not be found
So I have added an import statement for the Design layer class: import mx.core.DesignLayer, and now I get the error on compile:
Definition mx.core::DesignLayer could not be found
What is DesignLayer? Why it could not be found even tough I import it?
Thanks.

You are probably building new functionality with an old SDK. Or perhaps you are reusing a third-party component that was built with a newer SDK inside you application built with an older SDK.
In either event the DesignLayer class was introduced in Flex version 4, as stated in the docs. So if you're building your application with some flavor of Flex 3, it makes sense the DesignLayer class can't be found, simply because it isn't there.
Go have a look in the framework's source code at [sdk-path]\frameworks\projects\framework\src\mx\core. In Flex 4+ you'll find the file DesignLayer.as there. Not so in Flex 3.

Related

VerifyError: Error #1014: Class mx.controls.advancedDataGridClasses::AdvancedDataGridRendererProvider could not be found

I am porting over a Flex application from 4.1 to 4.5 and have run into some issues with the AdvancedDataGrid classes being found. The application compiles ok under 4.5.1 but at runtime I get the following error:
VerifyError: Error #1014: Class mx.controls.advancedDataGridClasses::AdvancedDataGridRendererProvider could not be found.
It appears that what was the old datavisualization.swc was divided into to libraries (advancedgrids_4.5.21328.swf and charts_4.5.21328.swf) both of which are present in my project. is there anything in the configuration that I need to update?
I am currently using Eclipse Java EE IDE for Web Developers (Helios Service Release 1)
Many thanks,
Ian
Verify error really means that there's something wrong with versions of classes you are trying to access at runtime.
First of all, you can try plaing with 'merged/rsl' settings. Second, you can double-check your includes or try to build your app outside ide, with ant task, for example.
You will have to merge your libraries into code. This might be helpful -
VerifyError: Error #1014: class could not be found

Flex Sub-Apps and MarhsallingSupport missing in 3.x SDK's

I'm looking at using Sub-Applications within flex, to enable mutli-versioned compilation.
Specifically, I'm looking to have a Flex 4.x host app that loads Flex 3.6 sub-apps.
The docs state this is possible (and the purpose of sub-apps). However they specify this:
When compiling each of these types of applications, you should include
the MarshallingSupport class into the main application and
sub-applications. You do this with the includes compiler argument, as
the following example shows:
-includes=mx.managers.systemClasses.MarshallingSupport
However, from what I can tell, MarhsallingSupport wasn't included until the 4.x releases.
Looking at the mx.managers.systemClasses package for 3.5.0.12683 and 3.4.1.10084 shows no reference of MarshallingSupport (see svn here and here)
This is also true for 3.6a (download of SDK available, but can't find the source).
Am I missing something? How am I supposed to include this class in the 3.x sub-apps, when it's not available?
see http://help.adobe.com/en_US/enterpriseplatform/10.0/AEPDeveloperGuide/WS8cbf8723eeed7311-4cca458e1328d74a115-7fff.html
Like module bundles, there are no special compilation requirements. You can build the
application bundle SWF in any way that is convenient. Note, however,
that application bundles must include marshalling support.
This is automatic with Flex 3, but with Flex 4 you must force the inclusion
of the MarshallingSupport class in your SWF.
For Flex 4 this can be
done by referencing the MarshallingSupport class in your application
code (as in the previous example). You can also explicitly force
inclusion of the MarshallingSupport class on the mxmlc command line
using the following option:
-includes+=mx.managers.systemClasses.MarshallingSupport

How to include resource bundles in ActionScript Modules using Flex 4.1?

In the simplest of Flex Projects, create an MXML Flex Module and then load it using the ModuleManager. No problem. Create an ActionScript class that extends Module and then configure your project to compile that into a Module. Load this new module instead. The project compiles, but crashes when running with the following error:
"Error: Could not find compiled resource bundle 'containers' for locale 'en_US'."
I believe the compiler is failing to compile the required class definitions into ActionScript only module, while it succeeds for the MXML module. I can see that my skeleton MXML module is slightly larger than my ActionScript module (66KB vs. 45KB).
How can I resolve this problem (if that is indeed the issue)?
A good approach in these sort of situations is to use -keep-generated-actionscript for two projects, one with the mxml approach, and one with the actionscript approach. You can then compare the code to see what might be missing from one project, but included in another.
Have you tried adding an explicit reference to [ResourceBundle("containers")] to your ActionScript project class? The mxmlc is different to the compc compiler in behaviour for many valid reasons.
I was having this same problem when compiling a library swc. I was able to fix it by adding the following section to the projects projectName-config.xml
<include-libraries append="true">
<library>${flexlib}/locale/{locale}/framework_rb.swc</library>
</include-libraries>
This forces the compiler to include the framework resource bundle for the specified locale.
for me the issue was finding out which project - in my case a library - and which class in this library caused this behavior (I needed to realize my last changes - no info from flashbuilder). Then applying the following attribute to the class:
[ResourceBundle("containers")]
public class IpChecker {
...
That did the trick.

Warning when migratring from Flex 3 to Flex 4

I received this warning when I migrated my application from flex 3 to flex 4:
components:MyApp is a module or application that is directly referenced. This will cause components:MyApp and all of its dependencies to be linked in with modules:searchModule. Using an interface is the recommended practice to avoid this. Unknown Flex Problem
MyApp is a class which extends the Application component and in the module named "searchModule" there's this line:
var parentApp:myApp = parentApplication as MyApp;
I then use the variable myApp to call methods defined in the MyApp class from within this module.
This warning is reported 10 times because I am doing the same in other modules.
I want to fix it but I don't understand the part "this will cause its dependencies to be linked in with modules" and how would I make an interface to avoid this? And why there wasn't a warning about it in flex 3?
Thanks in advance
I'm guessing a bit, but...
The Flex Framework is one of those special Adobe-only libraries that can be cached by the Flex player. As such, with certain compile settings, the SWF from the compiler does not contain the Flex library. In lex 4, the framework is not compiled into your application SWf, resulting in significantly smaller application file size.
If you extend the Application class, which it sounds like you done, the compiler cannot count on your new "Application" being in the cached Flex Framework and therefore must compile your new class, and therefore the Application tag into your SWF. This is going to daisy chain significantly; as the Application tag does a lot of Flex Framework setup stuff.
I assume that is what the warning means in terms of dependencies.
Did you really extend Application with additional functionality? Or is "MyApp.mxml" just the name of the your main application file?
You might try this:
var parentApp:Application = parentApplication as Application;
I believe there is a FlexGlobals class introduced in Flex 4, which can also give you access to the top level Application.
In terms of using an interface. Interfaces are designed to help remove specific dependencies. You can create an interface for your new functionality of the new Application class and reference that instead.
var parentApp:myApp = parentApplication as IMyApp
Based on my interpertation of the messages you're seeing that may address the issue.
I had this error when I had Application MXML insted of Component MXML, for example.
Changed Application to Group, in referenced Component, and warning was no more.
Reason for error was, because I worked on component in separate project as application, and later copied it to main project, but I didn't change it to component.

Problem modulating action script project

I am refactoring a hugh action script solution in Flash builder (beta 2) using the flex 4 sdk.
The project does NOT use the mx framework.
What i want to have is:
A big 'MAIN' project
several small 'MODULE' projects. each 'MODULE' class refrences the 'MAIN' project as an External reference (doesnt compile into swf) - this is done by setting link type = external in the 'MODULE' project properties -> library path.
'MAIN' loads a 'MODULE' project on runtime using the 'loader' class.
the problem:
I recieve an error from the MODULE project:
VerifyError: Error #1014: Class [some class in MAIN] could not be found.
PLEASE HELP!
Check which application domain you are loading your module into. The app domain needs to be able to access the class you have externalised or you'll get that error.
It might just be a bug with the beta version of the sdk. It seems like the import of a class in a module created in another project doesn't force it's inclusion in the main swf.
try putting a dummy dependency in you main application class, like:
private var forcedImports:Array = [MyClass];
It fixed some of my problems before.

Resources